for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox ck=(CheckBox)GridView1.Rows[i].Controls[0]; if(!ck.Check) { GridView1.Rows[i].visible=false; } }
carlecomm
Posts
-
how to remove the rows from the gridview control when check box is unchecked -
How to get DataGridView Checkbox Checked or not ! [modified]Please change "bool IsChecked = ((CheckBox)datagridview1.rows[i].Cell["ID"].Value).Checked;" to "bool IsChecked = ((CheckBox)datagridview1.rows[i].Cell["ID"].FindControl["CheckBox1"]).Checked;" and have another try.
-
getting and setting textbox.txt value in XAML from C# in WinformYou can samply convert the child control to TextBox. Try this: private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { System.Windows.Controls.TextBox tb = (System.Windows.Controls.TextBox)(elementHost1.Child); tb.Text = e.Node.Name; }
-
Add Custom Color in ColorDialogTo create a custom color, 1. In the More Colors dialog box, click Custom... . The Color dialog box is displayed. 2 Try one of the following: a. Use the color matrix and the saturation gradient to create a color by clicking inside the matrix. Then use the saturation gradient pointer to select a saturation level. b. Enter the HSL or RGB values for the custom color. The custom color is displayed in the Color/Solid box. 3. If you want to create more colors, click Add to Custom Colors to add the color to the Custom colors palette. You can then repeat step 2 to create other colors. 4. Click OK to assign the color to the page element that you have selected on the page.
-
AddString()private void AddStringExample(PaintEventArgs e) { // Create a GraphicsPath object. GraphicsPath myPath = new GraphicsPath(); // Set up all the string parameters. string stringText = "Sample Text"; FontFamily family = new FontFamily("Arial"); int fontStyle = (int)FontStyle.Italic; int emSize = 26; Point origin = new Point(20, 20); StringFormat format = StringFormat.GenericDefault; // Add the string to the path. myPath.AddString(stringText, family, fontStyle, emSize, origin, format); //Draw the path to the screen. e.Graphics.FillPath(Brushes.Black, myPath); }
-
Editing in gridviewIn gridView RowDataBound event, disable the editor when type is Cash.
-
nvarchar vs varcharVARCHAR is a variable length string of ASCII characters while NVARCHAR is a variable length string of UNICODE characters.Since NVARCHAR can handle unicode characters, so it allows to use multiple languages in the database. Each ASCII character takes one Byte of space while each UNICODE character takes two Bytes of space. It means NVARCHAR takes twice as much space to store to allow for the extended character set required by some other languages.
-
Regular ExpressionYou can use the following regular expression to validate it. "^[0-9]*[1-9][0-9]*$"
-
append node by element nameYou can use c# DOM to access the XML or DHMTL. Try this: http://progzoo.net/wiki/C%23:Navigating\_over\_DOM\_Tutorial
-
Creating new Silverlight project silently crashes Visual Web Developer 2008I suggest you reinstall the visual studio. Most of these problems will be solved in this way.
-
Response.End()Hi, If you use 1. Response.End,you should try ApplicationInstance.CompleteRequest 2. Response.Redirect,please change it to Response.Redirect(String url, bool endResponse),set endResponse as false. For example, Response.Redirect ("nextpage.aspx", false); 3. Server.Transfer,please change it to Server.Execute. Hope this helps:)
-
Table and panelHi, Do you want this: < asp:Panel ID="Panel1" runat="server"> < table> < tr> < td> </td> </tr> </table> </asp:Panel> Or this: < table> < tr> < td> < asp:Panel ID="Panel2" runat="server"> </asp:Panel> </td> </tr> </table>
-
Table and panelSure. You can both place a panel inside the table and place a table inside the panel.You can have a try by yourself.
-
how hyperlink connected excel file save in Project in Asp.net..Pls help meHi, Actually, I do not understand your requirement clearly. However, if you want to save the file without any location, you should get the file when the page is opened. Or IF you just want to get the file to your project and want to do some changes, why not get the whole project and check out the file??
-
crate a new avi/wmv file from byte arrayI think you can use the DirectShow, and it can help you get the type of the video and decode the video. Try this: http://en.wikipedia.org/wiki/DirectShow
-
imagePlease try this: http://www.shabdar.org/store-save-images-in-sql-server.html
-
if statement in the html code in aspx pageHi, If you just want to change the forecolor, you can try this: string test1 = "John"; string test2 = "Jim"; string testStr = Label1.Text;//source string if (testStr.IndexOf(test1) > 0) Label1.ForeColor = System.Drawing.Color.Red; else if (testStr.IndexOf(test2) > 0) Label1.ForeColor = System.Drawing.Color.Blue; Hope it helps:)
-
change forecolor of a label in gridview [modified]hi, Here is an example: gridview_OnDataBound(){ Label label1 = e.Item.FindControl("lable1") as Label; Label label2 = e.Item.FindControl("lable2") as Label; if(lable1.Text == "1") { label2.ForeColor = "red"; }else if(lable1.Text == "2"){ label2.ForeColor = "blue"; } } Hope it helps:)
-
How do you create a query string with JavaScript and access the values in Code BehindHi, You can try this: function QueryString(qs) { s = location.href; s = s.replace("?","?&").split("&"); re = ""; for(i=1;i<s.length;i++) { if(s[i].indexOf(qs+"=")==0) { re = s[i].replace(qs+"=",""); } } return re; } then you can do sth to access the pass to anywhere.
-
Calling a js function from a different aspx.cs page problem. [modified]Hi, You can try the code below: Child page: if (!IsPostBack) { CloseButton.Attributes.Add("onclick","return _SetValue();"); } function _SetValue() { var lblRelated = window.opener.document.getElementById('Related'); var lblQuery = document.getElementById('Query'); lblRelated.innerText = lblQuery.innerText; window.close(); } Hope it helps:)