Sr No in GridView
-
Hi All, I need to display Sr No in GridView, in dataset I dont have Sr No column.Please tell me how do I do this... Thanks in advance...
-
Hi All, I need to display Sr No in GridView, in dataset I dont have Sr No column.Please tell me how do I do this... Thanks in advance...
two things can be done... 1.Make an Autogenerate column in your Database table if your query doesnt include any JOINING......i.e if you are fetching record from 1 table.... 2.If the case is not so...then u have to make 1 column in your DataSet table ....i.e u have to make a customized dataset from your existing dataset.....
Tirtha Miles to go before I sleep
-
two things can be done... 1.Make an Autogenerate column in your Database table if your query doesnt include any JOINING......i.e if you are fetching record from 1 table.... 2.If the case is not so...then u have to make 1 column in your DataSet table ....i.e u have to make a customized dataset from your existing dataset.....
Tirtha Miles to go before I sleep
Hi Tritha, Thanks for Reply.First case I cant use because if few rows are deleted then its will show me sr no as 1 2 4 5 etc. But I think I can use second option.Can u please help me with the code.I am using ASP.NET 2.0(VB) or is there any way we can do it with Query Thanks...
-
Hi Tritha, Thanks for Reply.First case I cant use because if few rows are deleted then its will show me sr no as 1 2 4 5 etc. But I think I can use second option.Can u please help me with the code.I am using ASP.NET 2.0(VB) or is there any way we can do it with Query Thanks...
Put column in datagrid -------------------- ------------------------------------ write in code behind page public string sn1() { int t; i = i + 1; t = (grd_category.CurrentPageIndex * pagesize) + i; return t.ToString(); } DataGridPageChangedEventArgs e) { grd_category.CurrentPageIndex =e.NewPageIndex; bind();//code to bind the grid } hope this would help you..