| |
Hi, i need help... i have a windows application, in which there a datagrid, and i have to show details in the grid in such a way, that when i click "Show Details"(which i can get as a row in the datagrid), the grid expands showingme more rows which get inserted where i clicked on show details... Similarly, when i click 'Hide Details", the rows are not shown...
Does any one has code for this funnctionality of datagrid? plz do help me... thanx, Deepa | | |
senthil kannan6 pointsPosted Jul 24, 2006, 1:50 AM EDT
if u want the datagrid to show nothing just set its datasource to null.
Here is the sample code,
private void Execute(string qry)
{
OleDbConnection oconn=new OleDbConnection(Connstr);
OleDbCommand ocomm=new OleDbCommand(Query,oconn);
OleDbDataAdapter oadap=new OleDbDataAdapter();
oadap.SelectCommand=ocomm;
ds.Clear();
oadap.Fill(ds,"tblSTU");
}
private void btnShow_Click(object sender, System.EventArgs e)
{
Query = "SELECT * FROM tblSTU";
Execute(Query);
dataGrid1.DataSource = ds.Tables[0];
}
private void btnHide_Click(object sender, System.EventArgs e)
{
dataGrid1.DataSource = null;
}
Hope this helps u.
deepa26 pointsPosted Jul 24, 2006, 2:26 AM EDT
plz check website :www.dohop.com, then perform some search ..u'll get recordswith hidden details..then when u click on 'Show Details" it expands
i have datatable with all details at first, then i need to manipulate it in such a way in the datagrid which will make it look like in the website :-/
plz check it...plz help me..its urgent...im confused
thanks a lot...
Deepa
raghu3 pointsPosted Jul 24, 2006, 8:28 PM EDT
Cheers,
Raghu
senthil kannan6 pointsPosted Jul 24, 2006, 11:49 PM EDT
i searched in net but could not find out a solution for this so i came up with my own application.
as i couldnt post my whole appln here i can send u thru mail
deepa26 pointsPosted Jul 26, 2006, 4:11 AM EDT
You can mail me at '[email protected]'
Thanks lots :)