Posts

Remove cell's in gridview edit mode

This code is used for removing all cells except first cell(cell[0]). In   cell[0] we will display edit itemTemplate.                     GridView editGrid = sender as GridView;                     int colSpan = editGrid.Columns.Count;                     for (int i = 1; i < colSpan; i++)                     {                         e.Row.Cells[i].Visible = false;                     ...

Bind data in rowdatabound inside gridview based on row type

1).  if (e.Row.RowType == DataControlRowType.DataRow && !e.Row.RowState.ToString().Contains("Edit")) { } This is used for  Edit for Particular Row  inside gridview 2).  if (e.Row.RowType == DataControlRowType.DataRow && dgSmsTemplates.EditIndex == e.Row.RowIndex) { } This is used for  Edit for Particular index (loading Control like editor) inside gridview 3).    if (e.Row.RowType == DataControlRowType.DataRow) { } This is used for  Edit  inside gridview for perticular row (not binding values at runtime)

Sharepoint Tips

Response Redirect in a web part A:- Try going to Page.Response (or SPUtility.Redirect() indeed) System.Web.HttpContext.Current.Response.Redirect([URL Link]); SPUtility.Redirect("login.aspx", SPRedirectFlags.RelativeToLayoutsPage, HttpContext.Current); Getting the URL Query string values in a Web Part A:-the way to use this is Context.Request[string key name]ToString(); string kquery = Page.Request.QueryString[ "kqry" ]; New in SharePoint 2010 CAML Query <IN>,<INCLUDES> &< NOT INCLUDES> Even though Microsoft encourages using LINQ in SharePoint 2010, they introduced some new CAML Query schema elements. They are · IN · INCLUDES · NOT INCLUDES IN: This is something work as same as what we see in SQL Query. We can provide a collection of Items to filter. Previously in SharePoint 2007 we have to use OR operator to do this.. But using OR for multiple times for multiple values will lead to lack in code clarity. So IN operator is c...

How to Recover Deleted Files without Using Software

Image
For example lets assume that you have permanently deleted "Heart.JPG" from the folder named "LIFE" ;) , and now you want to recover "Heart.JPG" back. Do this simple trick to recover your Heart.JPG Right Click on the particular folder Select "Restore previous versions" That's all, now you will see a option to recover the particular file. If you don't see "Restore previous Versions" by Right Clicking, Go to Control Panel --> System and Secutiry - -> System --> Click on System Protection (in left sidebar) --> Select the particular drive and Click Configure --> Then select "Restore system setting and previous versions of files" --> Now Click on OK Note : Previous versions come from restore points or from windows backup. This trick will not work at all the time. If you haven't get back your deleted files yet, Use this Powerful Data Recovery Software (Recuva) to recover your deleted files.

How to make Windows 7 genuine using Command Prompt

Image
How to make Windows 7 genuine using Command Prompt Press Windows key + R Now "run" box will appear , in "run" box type CMD  Click on OK Note : Run CMD as Administrator Now command prompt will appear In command prompt type SLMGR -REARM Hit Enter. Wait 5-10 seconds Now a message will appear as shown in image below. Done !!! Now your Windows 7 is genuine .. :D Restart your PC once. Hereafter you won't see the warning message that "Windows 7 is not genuine"

find datakey name's in gridview event handlers

1)In row databound  if (e.Row.RowType == DataControlRowType.DataRow)                 {                     int datakey = Convert.ToInt32(dgFixtures.DataKeys[e.Row.RowIndex].Value.ToString());                   } if (e.Row.RowType == DataControlRowType.DataRow && GridTeamOfficials.EditIndex == e.Row.RowIndex)                 {                 }                 if (e.Row.RowType == DataControlRowType.DataRow)               ...

ASP.NET Website vs Web Application project

When you add a class file to the website project it will prompt you that it will place the file in App_code folder under root. Notice  In website project type namespace won't add to the class by default however you can define the namespaces explicitly where as in WebApp it creates the namespace for the class file when you added it to the project. WebApp project type is restricted to one language where as Website you can add different language files to the App_Code folder which compiles the files dynamically.   Referring a user control in WebApp is straight forward.You can define the properties and can be accessed in class files like any other objects where as in website it is not.   We can put multiple language files in the Website but those files needs to be in same folder. If you change the location of the file then you need to mention in the Web.Config file as follows.. <codeSubDirectories>  <add directoryName="Testfolder"/>  </code...