Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
20
Reply
Select Gridview Row in ASP.Net
rachayita jaiswal
Aug 30 2013 1:00 AM
5.9k
Reply
Hi, I have created a grid view and i am fetching data in this from database. Grid view and designing of controls both are in one form.
I want to fill all controls (text box n all) by clicking on grid view row.
In my grid view 5 fields are there but in design i have many controls. I have done this coding -
protected void grdv_assets_OnSelectedIndexChanged(object sender, EventArgs e)
{
txt_assetcode.Visible = true;
int rowIndex = grdv_assets.SelectedIndex;
txt_assetupdatemode.Text = "true";
ddl_assettype.SelectedValue = grdv_assets.SelectedRow.Cells[1].Text.Trim();
txt_assetbrand.Text = grdv_assets.SelectedRow.Cells[2].Text.Trim();
txt_assetmodel.Text = grdv_assets.SelectedRow.Cells[3].Text.Trim();
ddl_assetVendor.SelectedValue = grdv_assets.SelectedRow.Cells[4].Text.Trim();
txt_assetPdate.Text = grdv_assets.SelectedRow.Cells[5].Text.Trim();
}
these 5 control ' s value are coming from gridview row to the control but how to fill rest control's in my design???
If my question is not clear, let me know....
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
20
)
Next Recommended Forum
steps to develop an inventory project using C#.net,MySQL,IIS
gridview inserting textbox