Tag Info

Hot answers tagged

5

Here are some links about how to implement paging and filtering in SPGridView Code Project reversealchemy


5

GridViews, as linked to by Ziga, are a standard .NET control. If you're asking about that, then you'd probably be better off asking at Stackoverflow; this is the forum about SharePoint technologies. However, SharePoint does have it's own SPGridView. It's much like the standard .NET one, but doesn't have some of the features of the .NET one (such as auto ...


3

I have put your code in the page load event and it resolves the issue. btnExport.UseSubmitBehavior = false; btnExport.OnClientClick = "_spFormOnSubmitCalled = false; _spSuppressFormOnSubmitWrapper=true;";


2

I don't know if this is what you are looking for, but it's a start - http://msdn.microsoft.com/en-us/library/ms752213.aspx


2

Firstly, to deal with the display of the results. You will most likely be using a CoreResultsWebPart to display the output of the search; this has an Xsl property which can be used to style the results in the style desired. Using this you can make the results appear as a GridView. However, there is no builtin control that will allow you to edit items ...


2

Alternatively, you could use SPFieldLookupValue (for a single lookup) and SPFieldLookupValueCollection (for a multi-lookup) to parse the field values using SharePoint's built-in methods for processing them. Here is a revised version of your function for single lookups: protected string RemoveCharacters(string fieldValue) { SPFieldLookupValue value = ...


2

The problem is that you are creating the CommandField button in a postback event: SumbitSearch_Click. Take a look at Wictor's wonderful graphic. Instead, you should be overriding the CreateChildControls function and creating most of your controls there. You'll notice, however, that on a postback the CreateChildControls will be called before your ...


2

The point is that you're changing only title of the field, while the column internal name remains unchanged. This behavour is intended, overwise your programmatic functionality may broke down if user accidentaly changes the field title. Also, fields titles could be localized. So, if you need to change field internal name, then probably the easiest way to do ...


2

Assuming you're working in server side code: Take a look a the Attachments property of the SPListItem, it returns an SPAttachmentCollection, from there itterate the SPFiles and use the Url property to get the site relative path and you should be sorted from there. Some times the docs on MSDN are actually quite helpful :)


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

Glolita, Use SPGridView instead of ASP:GridView... Here is a nice article: How to use the SPGridView filter together with a SPDataSource I also noticed in every example in CAML before <Query> they are using <View>, but I don't know if this is really the problem... can you please try that as well Also, SPTypes.DataSourceMode="List" Hope ...


2

<asp:TemplateField HeaderText="Date Range"> <ItemTemplate> <%# string.Format("{0:dd MMM yyyy}", Eval("From_Date")).Equals(string.Format("{0:dd MMM yyyy}" ,Eval("To_Date")))? string.Format("{0:dd MMM yyyy}", Eval("From_Date")) : string.Format("{0:dd MMM yyyy} {1:dd MMM yyyy}", Eval("From_Date") ,Eval("To_Date"))%> ...


2

Try using SPListItemCollection.GetDataTable like this: var dt = list.GetItems(oQuery).GetDataTable(); gridView.DataSource = dt; When you just use list.GetItems(oQuery) as the DataSource what the GridView gets is a SPListItemCollection which it doesn't understand, but it's an IEnumerable which it understands. So now the GridView can enumerate the ...


2

SPGridView has much less functionality than GridView, I found it frustrating to work with in SharePoint 2007 in terms of presentation. This is a great intro and here is help on filtering


1

You can use built-in server controls in a SharePoint-Hosted app. You just can't use any code-behind. The markup for the various data source and UI controls remains the same. <SharePoint:SPDataSource ID="SPDataSource1" runat="server" DataSourceMode="List" SelectCommand="<Query></Query>" > <SelectParameters> ...


1

After dtRow["Name"] = user.Name; dtRow["Email"] = user.Email; Write dtRow.update(); Well, speaking more broadly, whenever you make a change to a list item, make sure you cal the update method to actually make the changes to the list item.


1

do know if this is a typo or not but shouldnt it be like this: protected void Button1_Click(object sender, EventArgs e) { CheckBox chkStatus = null; chkStatus = (CheckBox)sender; bool status = chkStatus.Checked; string strBoolean = Convert.ToString(status); SPSite oSiteCollection = SPContext.Current.Site; using(SPWeb oWeb = ...


1

This isn't the most dynamic solution but it should work... replace col_index with the column number... could add more before the "td" selector, such as the container id or class name to make the selection more fine-tuned. $('tr>td[role="gridcell"]:nth-child(col_index)').attr("aria-readonly","true");


1

The Data View Web Part is all about aggregating and managing data from various data sources, so u can create Custom Views also try........ http://onlinecoder.blogspot.in/2011/05/using-sharepoint-2010-data-view-web.html


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

The following link was very helpful in understanding the response issue that I was facing. It was solved by setting a few flags. http://mytechsoup.com/?p=36


1

I had the same issue on my last project. The main problem is sharepoint catches form submits and downloads so you cannot double click a button. So I added this to the page <script type="text/javascript"> _spOriginalFormAction=document.forms[0].action; _spSurppressFormOnSubmitWrapper = true; </script> I Think that fixed that issue, but ...


1

Have you tried? grid.Columns[i].ItemStyle.Width = 200


1

if you are using custom code, why do you actually need to save the list items before the order is created? Cant you just store them locally in the code until the submission is completed? If you cannot, have your webpart generates its own GUID that it can use to store all of the order items in a temporary list before they are ready to be added to the ...


1

You can set the DataFormatString property on your date BoundField: boundField.DataFormatString = "{0:d}"; A similar question was asked on Stackoverflow.


1

One thing that comes into my mind is to create a custom list schema which includes the appropriate CAML to render the video file as HTML5 video tag. This would of course require that you either use a modern Web browser (e.g. IE9 or the latest version of Firefox/Chrome/Safari/Opera) or employ a technique described at the "video for everbody" page ...


1

You would have changed the display name (Title property), not the internal name (InternalName property). Fields are usually referenced by their internal names when using the API in SharePoint, although there are quite a few places where both the display name and title can be used. You must use the original name of the column, or recreate the field with the ...


1

Use the ViewFields property on your SPQuery to return only the fields you need, add in: query.ViewFields = string.Concat( "<FieldRef Name='Title' />", "<FieldRef Name='Mobile' />", "<FieldRef Name='EmailId' />"); query.ViewFieldsOnly = true; // ...



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