Posts

Showing posts from April, 2012

How to Deploy windows application in C#

Image
Step 1 :   In Solution Explorer Click on Add new project --- Setup & Deployment  --Give setup name--OK Step2 :    File System screen appears Step3 :   Right click on Application  folder ---Project Output --Click on the setup file (.cs) Step4 :  Create a shortcut on of the setup created and cut it. Step5 : Right click on User Desktop folder--paste the copied setup. Step6 : Build the setup.

Paging for Datagridview (e.g. 1.2.3...)

Image
1. Add following lines in GridView  tag of aspx    AllowPaging="True" PageSize="100"    PagerSettings-Position = "TopAndBottom"    OnPageIndexChanging="EventName" 2 . Write the Event function in .CS file       datagrid.PageIndex = e.NewPageIndex;        this.functiontofilldatagrid(); // call the function where grid is loaded e.g. In Aspx: <asp:GridView ID="dtgoutwardstockspare" runat="server" AutoGenerateColumns="False" AllowPaging="True" PageSize="100"  PagerSettings-Position = "TopAndBottom"                                             OnPageIndexChanging="Paginateoutwardstockspare"/> In .CS:  protected void Paginateoutwardstockspare(object sender, GridViewPageEventArgs e)         {             dtgoutwardstockspare....

DataView Concept

DataView is similar to Dataset but in dataview we can filter the records. eg. DataView dv = new DataView(datatable); string QryStr = "PageNoFrom <=" + PgNos + " " + "and" + "  " + "PageNoTo >=" + PgNos; dv.RowFilter = QryStr; int PAGENOSTO = System.Convert.ToInt32(dv[0]["PageNoTo"].ToString());

How to stop a comboBox's selectedIndexChanged event from firing when the form loads

If you want to react only when user change selected item in combo box, then it is better to subscribe to SelectionChangeCommitted