Xaisoft:I have a gridview with two data keys. I can access one datakey fine via the CommanArgument of the GridView, but I am unsure of how to access two data keys?
Thanks,
X
in those situations, we will specify the command argument as
CommandARgument = '<%# Container.DisplayIndex %>'
which will give the rowno. once we get rowno, we can access all
now in rowcommand event,
int rowno = Convert.TOInt32(e.CommandArgument);
string col1 = gridview1.datakeys[rowno]["column1"].tostring()
string col2 = gridview1.datakeys[rowno]["column2"].tostring()
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.