473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

to retrieve selected value from onegridview and display in other gridview

Hi to all,
I have one gridview with checkboxes which contains values of type integer(empid) and string(name) and if i checked it, those respective values must be displayed in other gridview.pls hlp me to do so.
Dec 5 '07 #1
3 1519
mzmishra
390 Expert 256MB
1. Create one datatable add two columns id and name
2. CheckBox chkBox = Grid.Items[i].Cells[0].Controls[1] as CheckBox;
int cnt=Grid.Items.Count;
for(int i=0;i<cnt;i++)
{
if (chkBox.Checked)
{
populate the datatable
}
}
3. Datagrid2.Datasource=DataTable
Dec 5 '07 #2
Hi,
I couldn't get entire thing.could u give more .because the empid comes from one table and name comes from another table.thats y? pls give eloborately
thanks
Dec 5 '07 #3
mzmishra
390 Expert 256MB
how you are populating your first grid ?must be through some dataset or something like that.
And your first datagrid column values you can get
Grid.Items[i].Cells[1] or cell[2] like this.

Then populate the new datatable
Dec 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Neil | last post by:
I have a gridview which is being populated with no problems. I want to be able to reference the data from the cells in the row but having followed an example on MSDN cannot get any data to be...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
1
by: Steve Kershaw | last post by:
Hi, I have a GridView in which I have selected a row. I now want to use the 1st column value of that selected row in another GridView as an input to select the particular row in the second...
1
by: kageyone | last post by:
I have a gridview in .net 2.0 with a dropdownlist of two items - that being "active" and "inactive". <EditItemTemplate> <asp:DropDownList ID="ddlStatus" runat="server"...
0
by: E. Kwong | last post by:
In a Gridview control, I have several BoundFields, and also a couple of TemplateFields. In the Rowupdating event, I try to retrieve one of the BoundFields (i.e. 4th column of the Gridview...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
0
by: furtiveferret | last post by:
Hi I'm still a newbie here, so please bear with me. At the top of the page, I display a gridview as a small scrollbox with 3 sortable columns (customer, region & contact) & a select button for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.