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
sameer gadade
NA
61
55.6k
retrival of values from grid view
Jun 6 2012 3:09 AM
hi,
i want to get values from gridview row to textboxes and dropdowns when i select the particular row below is my asp code
i tried for selectedindex changing event of gridview but unable to call that event. do i miss any property?
please help?
asp code:
<asp:GridView ID="GridViewFeeType" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
CssClass="grid_style" Width="550px"
onrowcreated="GridViewFeeType_RowCreated" AllowSorting="True"
onsorting="GridViewFeeType_Sorting"
onpageindexchanging="GridViewFeeType_PageIndexChanging" BackColor="White"
DataSourceID="SqlDataFeeType">
<Columns>
<asp:BoundField DataField="Fee_Type" HeaderText="Fee Type"
SortExpression="Fee_Type" >
<ItemStyle Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="Fee_Type_Desc" HeaderText="Fee Description"
SortExpression="Fee_Type_Desc">
<ItemStyle Width="300px" />
</asp:BoundField>
<asp:BoundField DataField="Is_One_Time" HeaderText="Is One Time"
SortExpression="Is_One_Time">
<ItemStyle Width="170px" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="theme_color" Height="20px" ForeColor ="Black"/>
<EditRowStyle CssClass="ListSmallData" />
<EmptyDataTemplate >
<table width = "550px" cellspacing = "0">
<tr>
<td class ="EmptyTemplateHeader_right_border" width = "80px">Fee Type</td>
<td class ="EmptyTemplateHeader_right_border" width = "300px">Fee Description</td>
<td class ="EmptyTemplateHeader_right_border" width = "170px">Is One Time</td>
</tr>
<tr>
<td style="color: #FF0000"> No Data Found...</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</EmptyDataTemplate>
</asp:GridView>
cs code:
protected void GridViewstream_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int row_index = e.Row.RowIndex + 1;
e.Row.Attributes.Add("onmouseover", "className='grid_row_mouse_over';");
e.Row.Attributes.Add("onmouseout", "className='grid_row_mouse_out'");
}
}
protected void GridViewstream_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
txtsub_strmname.Text = Convert.ToString(GridViewstream.SelectedRow.Cells[0].Text);
txtsub_strmcode.Text = Convert.ToString(GridViewstream.Rows[e.NewSelectedIndex].Cells[0].Text);
}
Reply
Answers (
3
)
Using OLEDB or ODBC & Native Driver
PDF document security and digital signing via C #