LinkButton in DataGrid
-
I have a datagrid already binded with dataset. And i have two columns the first column contains Image and the second column contains a table . In the table i have two rows. And in particular column say 2nd row 2nd column i have to create number of linkbutton which i get from another query. This is way i have done my codes. But i am not able to display Total number of linkbuttons . public string Call_Author(string IsbnID) { string AutnorName=""; DataSet ds; ds = objAddDL.Call_Author(IsbnID); string allname="", AuName=""; foreach (DataRow dr in ds.Tables[0].Rows) {AuName = dr[0].ToString(); } string tempAu = Server.UrlEncode(AuName); return "" + AuName + ""; }
VanithaVasu
-
I have a datagrid already binded with dataset. And i have two columns the first column contains Image and the second column contains a table . In the table i have two rows. And in particular column say 2nd row 2nd column i have to create number of linkbutton which i get from another query. This is way i have done my codes. But i am not able to display Total number of linkbuttons . public string Call_Author(string IsbnID) { string AutnorName=""; DataSet ds; ds = objAddDL.Call_Author(IsbnID); string allname="", AuName=""; foreach (DataRow dr in ds.Tables[0].Rows) {AuName = dr[0].ToString(); } string tempAu = Server.UrlEncode(AuName); return "" + AuName + ""; }
VanithaVasu
Are you able to assign required number of link button to the correct cell ? The code which you supplied doesn't make any sense to me.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Are you able to assign required number of link button to the correct cell ? The code which you supplied doesn't make any sense to me.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Ya , i got it. But can u tell me is there any other Simple way . And here is my code which worked out. But if this method , i implemented it make be coding conjusted when i have to do some operations on selection of the particular linkbutton. HTML -------- ]]>'> CodeBehind ----------- public string Call_Author(string IsbnID) { ArrayList AuthorCount = new ArrayList(); DataSet ds; ds = objAddDL.Call_Author(IsbnID); // Select query to fetch all author names where IsbnId="someruntimevalue"; string AuthorName=""; foreach (DataRow dr in ds.Tables[0].Rows) { AuthorName = dr[0].ToString(); AuthorCount.Add(AuthorName); } string retval=""; int ACount = AuthorCount.Count; if (ACount == 1) { retval = "" + AuthorCount[0].ToString() + ""; AuthorCount.Clear(); } if (ACount == 2) { retval = "" + AuthorCount[0].ToString() + "" + " , "; retval += "" + AuthorCount[1].ToString() + ""; AuthorCount.Clear(); } if (ACount == 3) { retval = "" + AuthorCount[0].ToString() + "" + " , "; retval += "" + AuthorCount[1].ToString() + "" + " , "; retval += "" + AuthorCount[2].ToString() + ""; AuthorCount.Clear(); } return retval;
VanithaVasu