Issue Populating the details view grid with selectedindex gridview - ASP.NET , C# -
on asp.net page have dropdown list - contains table names db. on selecting 1 table list, gridview below populated information found in table.
some of tables have plenty of columns , making impossible view, l included details view me view columns.
on selecting row in gridview, details view populated rows data. each table has different column names , numbers, facing problem detailsview not populated , when l click 'edit' or 'delete'. gives error events not handled. pointers/help appreciated. should able ot edit information, update in gridview , in turn updating in table.
here code populating detailsview
protected void gridview1_selectedindexchanged(object sender, eventargs e) { dtvinformation.datasource = gridview1.selectedrow.tostring(); dtvinformation.databind(); }
below code populating gridview
protected void dropdownlist1_selectedindexchanged (object sender, eventargs e) { sqldataadapter da = new sqldataadapter(string.format ("select * {0}", drptable.selectedvalue), con); dataset ds = new dataset (); da.missingschemaaction = missingschemaaction.addwithkey; da.fill(ds); gridview1.datasource = ds.tables[0]; gridview1.databind(); }
wiki
Comments
Post a Comment