c# - Force the user to select minimum two check boxes in each section in gtrid view? -


I have to select besed checkbox on group column values. If you see the gridview below, the column 3 (group number) has 1,1,1,1,2,2,2,2 .... ( This column data is not static, based on the page index . i.e. PageIndex = 2 can begin with 7,7,8,8,8,9,9,9 etc ).

Now my question is.

Every denomination / group user should select at least 2 check boxes. So if the user selects only one check box then we need to show a pop up message "Please select another check box in that particular section" If the user leaves the message and goes to the next section, then we will get the same The message will be shown We need to emphasize the user to select more than one checkbox in the same section.

Mainly our aim is the check box that is related to a category of users selected in each section / group.

Please help me in this requirement. thank you in advanced.

alt text

< P>

You need to use custom validation and see it in the code to run gridview rows again Required Edit: You need to add some more checks .....

  int GroupCount = 0; (Int count = 0; count & lt; grd.rows.Count; count ++) {int GroupNo = ((label) grd.Rows [count] .FindControl ("yourGroupNoLable"). Text; if (((checkbox) Grd.Rows [count] .FindControl ("yourCheckbox") checked) {GroupCount = GroupCount + 1;}}  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -