TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ismail lunat
NA
1
0
Unable to get value of Cell from GridView
Nov 12 2007 9:28 AM
Hi All.
I am using a GridView to List contacts linked to a logged in User.
I can successfully bind the Gridview with a DataTable. And the values in the GridView are correctly displayed.
I have a BoundField at Index 0 of the GridView which pulls a value from a Column in the DataSource (datatable).
The problem I am facing is that all the values in the cells are coming back as empty strings.
Can Anyone help me understand what I am leaving out and what I am doing wrong.
Code is as below:
protected void grdContactList_RowCommand(Object sender, GridViewCommandEventArgs e)
{
Global.BindGridView(ref grdContactList, Global.g_dtContacts);
if (e.CommandName == "EditContact")
{
string strCmdArg = Convert.ToString(e.CommandArgument);
string strContactID = grdContactList.Rows[Convert.ToInt32(strCmdArg)].Cells[0].Text;
Server.Transfer("EditContact.aspx?contactid=" + strContactID);
}
else if (e.CommandName == "DeleteContact")
{
string strCmdArg = Convert.ToString(e.CommandArgument);
string strContactID = grdContactList.Rows[Convert.ToInt32(strCmdArg)].Cells[0].Text;
string strAgentID = grdContactList.Rows[Convert.ToInt32(strCmdArg)].Cells[1].Text;
Contact.DeleteContact(strContactID, strAgentID);
}
}
The values of both strContactID and strAgentID are coming back as "".
BindGridView(...) is basically...
GridView.Datasource = dtDatatable;
GridView.Databind();
Thanks.
Reply
Answers (
1
)
all about RadioButtonList
Set focus text filed