Mám 2 GridView
na tej istej stránke, kliknite na Gridview1
bunka musí zmeniť údaje v Gridview2
, Je ich akýmkoľvek spôsobom v c #.
<asp:GridView runat="server" ID="GridView1" OnRowDataBound="GridView1_RowCreated">
<asp:GridView runat="server" ID="GridView2" OnRowDataBound="GridView2_RowCreated"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
onpageindexchanging="gv_PageIndexChanging" PagerSettings-PageButtonCount="5" AllowSorting="true" onsorting="gv_Sorting" >
Databinding
sa deje v codebehind
odpovede:
0 pre odpoveď č. 1Môžem "t komentovať, ale budem sa snažiť pomôcť. Vyskúšali ste niečo podobné v kóde."
string name = GridView1.SelectedRow.Cells[0].Text;
To by bolo v jednom z takýchto podujatí Gridviewako Gridview Selected index zmenený. Hrajte si s variáciami, ak to nefunguje správne. Ak hodnota bunky, ktorú potrebujete, je z jedného konkrétneho stĺpca, malo by to fungovať. Zmeňte bunky [0] na bunky ["Your Column Index"].