估计难实现。
这种情况下就不要采用DATAGRID了。
这种情况下就不要采用DATAGRID了。
解决方案 »
- 两个 RadioButtonList
- 很急很急很急 两个repeater嵌套 外层的按钮的单击事件不起作用,在线等……!
- .net怎么实现单击页面左边的导航按钮,让右边的iframe显示不同的页面
- 关于javascript调用web服务的安全性问题
- 求助:在.net2003中的.vsdisco文件有什么用处啊?好象在一些.net中没有这个文件啊?
- join on 与inner join 有没有区别?
- 对ASP.NET 中有一些问题还很模糊,望技术牛人解释一下.
- 高分求教怎样把EXCLE文件内的数据倒到数据库里
- 读取数据库每一条记录
- mvc3 将Controllers作为类库分离出来以后 调试报404错误
- 一个简单的sql问题
- 在网页中,我要。。。。消息框,怎么办!!!!
不然就在后台bounditem的时候做处理。。要么就用模板。
<script language="C#" runat="server">
//..databind your datagrid in other methodprotected override void Render(HtmlTextWriter output)
{
StringWriter sw;
HtmlTextWriter htmltw;
sw = new StringWriter();
htmltw = new HtmlTextWriter(sw);
base.Render(htmltw); String temp = sw.ToString();
Regex re = new Regex(@"(<table.*?id=""MyDataGrid.*?>.*?<tr.*?>.*?</tr>)(.*?)(<tr.*?>.*?</tr>)(.*?)(<tr.*?>.*?</tr>.*?</table>)", RegexOptions.IgnoreCase | RegexOptions.Singleline); //modify the temp any way you want
temp = re.Replace(temp,"$1<ttable>$3</ttable>$5");
//write it out
output.Write(temp);
}</script><form runat="server">
<ASP:DataGrid id="MyDataGrid" runat="server">
</asp:DataGrid>
</form>
{
if(e.Item.ItemIndex < 0) return;
e.Item.Attributes.Add("OnClick",Page.GetPostBackClientEvent(e.Item.Cells[0].Controls[0],String.Empty));
e.Item.Attributes["onMouseOver"] = "javascript:this.bgColor='SteelBlue';";
e.Item.Attributes["onMouseOut"] = "javascript:this.bgColor='green';";
}运行后你可以看一下<tr>里的代码,呵呵