In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to dynamically set whether CommandField is available or visible in GridView, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The code is as follows:
Protected void gvMaterial_RowDataBound (object sender, GridViewRowEventArgs e)
{
If (e.Row.RowType = = DataControlRowType.DataRow | | e.Row.RowType = = DataControlRowType.Header)
{
E.Row.Cells [0] .visible = false
}
If (e.Row.RowType = = DataControlRowType.DataRow)
{
E.Row.Cells [1] .text = (gvMaterial.PageIndex * gvMaterial.PageSize + e.Row.RowIndex + 1) .ToString ()
String price
Try / / make editing functions available under certain conditions
{
Price = ((TextBox) e.Row.Cells [4] .controls [0]) .Used when editing the Text;// point
}
Catch
{
Price = e.Row.Cells [4] .Text; / / for use at the beginning
}
If (price = "" | | price = = "")
{
E.Row.Cells [7] .controls [0] .visible = false
}
Else
{
E.Row.Cells [7] .controls [0] .visible = true
}
}
}
Thank you for reading this article carefully. I hope the article "how to dynamically set whether CommandField is available or visible in GridView" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.