4

Bind the data to column in gridview, and set visibility property of that column to false Or you can hide using javascript similar post


4

First, Visual Web Part has a code behind so you can add ASP.Net control like Gridview and add your dropdown list control to a template field as shown below <asp:GridView ID="GridView" runat="server" onrowdatabound="GridView_RowDataBound"> <Columns> <asp:TemplateField> <ItemTemplate> <...


3

Filtering oGrid.AllowFiltering = true; oGrid.FilterDataFields = "Title"; //tells the SPGridView what columns we want to be able to filter on. oGrid.FilteredDataSourcePropertyName = "FilterExpression"; oGrid.FilteredDataSourcePropertyFormat = "{1} like '{0}'"; //property provides the format for our filter expression in a SQL-like syntax. Sorting oGrid....


2

You can create a view using SPView class and in query give Author=[Me] and set this view as default view About the default "All Items" view, set its permission to be viewable to only Administrators or Group with Full Control... See How to create SPView Programmatically and Programmtically create SPView Let me know if you need more help!


2

https://code.msdn.microsoft.com/office/Ejemplos-sobre-cmo-usar-el-69cd5f16 SP GridView Sample Code with C sharp


2

Yes, it is possible but it is kind of a hack. Step 1: Make your filter values pretty For this, you'll need to create a class inheriting from SPGridView and override the GetCallbackResult function: public class SPFilterGridView : SPGridView { protected override string GetCallbackResult() { string result = base.GetCallbackResult(); // do ...


1

I find :) e.Row.Height = new Unit(25); if (grid.Columns.Count > 1) for (int i = 1; i < grid.Columns.Count; i++) e.Row.Cells[i].Wrap = false;


1

Bill's answer worked for me. In our application page, we need to override styles coming from Core.css which is shown in Bill's answer.


1

Maybe It's not what you are looking for, I'm just sharing. I used this styles in all of my project whenever I utilize SPGridView to display data. Style="border-bottom-style: none; border-right-style: none; width: 100%; border-collapse: collapse; border-top-style: none; border-left-style: none;" CssClass="ms-listviewtable" ...


1

Here is what I did, it seemed to work. But i know its not the final answer. <style type="text/css"> .ms-viewheadertr th{ padding-top:0px; background-color:#2878C0; color:White; } .ms-viewheadertr .ms-vh2-gridview{ height:auto; background-color:#2878C0; color:White; } .ms-menuimagecell{ border:0px; } .ms-vh .ms-menuimagecell,.ms-vh2 .ms-...


1

Create a descendant of SPGridView and add a method to clear the filter. public class MySPGridView : SPGridView { public void ClearFilter() { base.RaisePostBackEvent("__SPGridView__;__Filter__;__ClearFilter__"); } }


1

You would need for sure to built it yourself by attempting to attach your own coding to it. This articles explains the mechanism triggering the filter behaviour http://ketulpatel.wordpress.com/2008/05/30/custom-filters-in-spgridview/, but as of yet (except probably when customizing the XSLTViewWebPart - which does not apply here) I haven't seen a hookup as ...


1

You would essentially have 2 ways to my knowledge, after launching a modal window: using the SPLongOperation which in result would show the actual progress bar and a message at the start, tasks executing or the end, example http://sharepointzen.wordpress.com/2012/09/30/using-splongoperation-for-synchronous-long-running-tasks-in-sharepoint/ or client side ...


1

Here's an example on how to use the SharePoint:SPMenuField on a SPGridView. Basically, you first have to add a SharePoint:MenuTemplate control, then a SharePoint:SPMenuField to the SPGridView columns collection, with the MenuTemplateId pointing to the ID of the SPMenuField control previously created.


1

You can try the below code, oGrid.AllowFiltering = true; oGrid.FilterDataFields = "Title"; //tells the SPGridView what columns we want to be able to filter on. oGrid.FilteredDataSourcePropertyName = "FilterExpression"; oGrid.FilteredDataSourcePropertyFormat = "{1} like '{0}'"; //property provides the format for our filter expression in a SQL-like syntax. ...


1

I haven't yet got a chance to work with SP 2013. But if I had the same requirement in SP 2010, I may go with XSLTListViewWebpart. You can specify the name of the List and the view to be used in the webpart. Here is an example of adding XSLTListview webpart to the page: http://sharepointnadeem.blogspot.in/2012/08/programatically-add-xsltlist-view.html


1

Yes, actually that control is the upgraded version of the SPGridView (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spgridview.aspx). You should be able to use the same SHarePoint 2010 examples, many available http://www.srinisistla.com/blog/Lists/Posts/Post.aspx?ID=129 http://blog.sharepointsite.co.uk/2010/10/spgridview-explained....


1

Yes it is possible, but you will need to implement sorting, filtering and paging yourself. This CodePlex project includes som basic examples. The key is that an SPQuery called on a list by list.getItems(yourSPQuery) (MSDN) will return list items that you can use to populate a DataTable or other datasource for the SPGridView


1

If table you want to bind SPGridView control with is SQL table then you can simply bind SPGridView with your SQL table, I would explain it in details but its already explained properly in this similar type of question, Sharepoint SPGridView Data Reneder-SQL


1

Your class SimpleSPGrid does not inherit from anything, so I presume it inherits from Object. CreateChildControls() is a method of the Control class. Since the Object class does not have a CreateChildControls() method, SimpleSPGrid can't override it. Solution: Change the line Class SimpleSPGrid to Class SimpleSPGrid : Control Another option, if you ...


1

As Arsalan mentioned you can create a SPView which does filter by Me. Here is the CAML query for doing that: query.Query = "<Where><Eq><FieldRef Name='Author' /><Value Type='Integer'><UserID Type='Integer' /></Value></Eq></Where>"; Here I have written a blog post which shows how to create a an SPView ...


1

ObjectDatasource takes the TypeName of your data source, not the Qualified name. You need to modify this Type t = myDataTable.GetType(); ds.TypeName = t.AssemblyQualifiedName; so you set the TypeName property to the type name for example "My.ObjectDataSource.NorthwindData" instead of "My.ObjectDataSource.NorthwindData, mscorlib, Version=2.0.0.0, ...


1

You can't. Datasheet mode is an ActiveX control. It is completely separate from the SPGridView. AFAIK, you can't use the datasheet activex control in your customizations and you can't customize the control itself.


1

You will need to override the OnPreRender method to escape the single quotes: protected override void OnPreRender(EventArgs e) { if (!string.IsNullOrEmpty(_gridDS.FilterExpression)) { _gridDS.FilterExpression = string.Format( _grid.FilteredDataSourcePropertyFormat, _grid.FilterFieldValue.Replace("'", "''"), ...


1

Why? My best guess is... inside views SharePoint can use the ID to build a URL to the item. To fix your issue, it will probably be easiest for you to just iterate over the DataTable rows and trim off the id;#.


1

Ok. I was being silly. I'm using a visual webpart, but the blogs I've been reading from were for 2007 webparts. In my OnInit, I was setting spGrid = new SPGridView(); dataSource = new SPDataSource(); which of course reset all the settings of the SPGridView and SPDataSource I set in the ascx page. Therefore AutoGenerateColumns were set back to true, ...


1

I hope you're calling the code in right order. protected override void CreateChildControls() { // you code here Controls.Add(yourgridviewid); //Important to call this after Control.Add... yourgridviewid.PagerTemplate = null; base.CreateChildControls(); }


1

I remember I also had this problem a while ago. And if I remember correctly, the only way to change the format of the date in the filter is to change the regional settings of the site. Go to Site Actions -> Site Settings and under Site Administration you will find Regional Settings. Here you can change under Locale how your date is formatted. For example, ...


Only top voted, non community-wiki answers of a minimum length are eligible