Geeks With Blogs
Md. Rakibul Alam Tanvi June 2013 Entries
Join Two SPList and show data in Grid View
I have two SPList Customer(Columns: “Title”, “MobileNo”) and Order(Columns: “Title”, “CustomerName” Lookup with customer Title). And I write following code. . SPList cList = spWeb.Lists.TryGetList("Cus... SPList oList = spWeb.Lists.TryGetList("Ord... DataTable cTable = cList.Items.GetDataTable(); DataTable oTable = oList.Items.GetDataTable(); var coList = from tbl1 in cTable.AsEnumerable() join tbl2 in oTable.AsEnumerable() on tbl1["Title"] equals tbl2["CustomerName"] select new { ItemName ......

Posted On Saturday, June 8, 2013 6:21 AM

Apply Hit Counter in SharePoint Site with Host IP
Create a list name “HitCounterList” (add ListItem: Url,VistedDate,User,ClientIP) in your site and apply following code in page load. SPSecurity.RunWithElevatedP... { SPWeb spWeb = SPContext.Current.Site.Root... if (spWeb.CurrentUser != null) { spWeb.AllowUnsafeUpdates = true; hitCounterList = myWeb.Lists.TryGetList(“Hit... SPListItem item = hitCounterList.Items.Add(); item [“Url”] = System.Web.HttpContext.Curr... item [“VisitedDate”] ......

Posted On Friday, June 7, 2013 9:16 AM

Edit SharePoint List Item From Data Grid
1. Bind data from SharePoint list to data grid. 2. Add a button in template field of data grid <asp:GridView ID="gvFeedBack" runat="server" Width="100%" AutoGenerateColumns="False" EnableModelValidation="True" Font-Names="Axiata Book" Font-Size="11px" ShowFooter="True"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" /> <asp:BoundField DataField="CaseNumber" HeaderText="Case Number" /> <asp:BoundField DataField="Place" HeaderText="Place" /> <asp:BoundField ......

Posted On Friday, June 7, 2013 4:15 AM

Send mail from even receiver to a user or user group
I have an Event Receiver that sends an email when an item is updated to a listpublic override void ItemUpdated(SPItemEventProp... properties) { base.ItemUpdated(properties); string subject = string.Empty; string from = string.Empty; string to = string.Empty; string bodyText = string.Empty; string cc = string.Empty; if (properties.ListTitle != "Feedback") { return; } else { using (SPWeb currentWeb = new SPSite(properties.WebUrl).O... { SPList list = currentWeb.Lists.TryGetList... ......

Posted On Thursday, June 6, 2013 10:52 AM

"Recently Modified" Hide form Quick Launch
To hide "Recently Modified" from Quick Launch find the place holder "PlaceHolderLeftActions" from your master page and make Visible false.<asp:ContentPlaceH... id="PlaceHolderLeftActions" runat="server" Visible="false"> </asp:ContentPlaceHolder... ......

Posted On Thursday, June 6, 2013 10:15 AM

“Recycle bin” and “View all site content” links hide from Quick Launch
Open your master page (v4 or custom master) with SharePoint Designer. Add following css class in your (Also can apply in custom css file) .s4-specialNavLinkList{disp... !important;} ......

Posted On Thursday, June 6, 2013 10:09 AM

Linq in Sharepoint and querying list items
Most of case we use CAML Query in sharepoint to filter splist data for custom development. But some time it’s difficult to filter list data using CAML query. So, we can use LINQ in our development practice. SPWeb spWeb = new SPSite(SPContext.Current.We... //Get list SPList list = spWeb.Lists.TryGetList("MyL... //Apply linq in list item List<SPListItem> total = (from SPListItem item in list.Items where Convert.ToDateTime(item["Vi... startDate && Convert.ToDateTime(item["Vi... ......

Posted On Thursday, June 6, 2013 9:54 AM

Copyright © Md. Rakibul Alam Tanvi | Powered by: GeeksWithBlogs.net