本文介绍了网格视图单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中创建了一个Grid View,并通过Template字段放置了一个下拉列表,它在同一行中包含其他两列.

我的需要:

当我更改该下拉列表的索引时,我想获取同一行中其他列的值,并且我想使用该值来执行某些功能.

请帮助我

Kishore R

I Created a Grid View in asp.net, and i put a dropdownlist via Template field.It contains other two columns in the same row.

My need:

When i changed the index of that dropdownlist, i want to get the value of other columns of the same row.and i want to use that value to perform some functions.

Kindly Help me

Kishore R

推荐答案

protected void drpstatus_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList drpstatus = (DropDownList)sender;
GridViewRow row = (GridViewRow)drpstatus.Parent.Parent;
int idx = row.RowIndex; 
}


protected void drpstatus_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList drpstatus = (DropDownList)sender;
        GridViewRow row = (GridViewRow)drpstatus.Parent.Parent;
        int idx = row.RowIndex; 
     
       
    }


这篇关于网格视图单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 11:54