 |
|
 |
Hi all, Iam new to the asp.net.My query is very basic one.but i can't able to find the solution. Just I take a gridview and add two templatefields and one boundfield. For the two template fields, i add checkbox control as one column and Radiobutton as another.Iam bounding data to third one.My problem is when i check the checkboxes in the gridview and press any button then the checkboxes became unchecked.what i have to do to bring the oldstate. Also the radiobuttons didn't working as a group, they behave individually.What i have to do to make them as a group(means only one radio button must be checked and remaining must be unchecked).
Please help me in solving the problem
Thanks in advance Raj
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am using a master page for the page I am putting the code in and at least for me ASP Content panes dont seem to like forms, is there a way around this issue?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi!
We have a checkbox inside of a datagrid. A row would be selected by clicking. A checkbox would be selected by ctrl and click. That is what we want to do.
Any idea would be grateful!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
THis is nice but you may want to show the screen as an image.
Also you might want to show how to use the gui piece so others can do the same, It is nice to know how the code is but many use the gui to create the screen,
good job.
cheers, Donsw My Recent Article : Ajax Calendar Control
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi..its really nice but can u help me if i make the ID Bound feild visible="false then str.Append(gvSupplier.Rows[i].Cells[0].Text) does not take the value.. cell[0] has ID
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello, If I select some checkboxes on the first page of the GridView and then go to another page, the selection on the first page dissappears. What should I do to make it work? Best regards, Przemek
EDIT: I already found your article about that: http://aspalliance.com/774[^]. Azamsharp, you are the GridView master! 
EDIT2: RePopulateValues() doesn't seem to work for me. According to the debugger, (CheckBox)row.FindControl("SampleCheckBox") finds the appropriate control, but when I change the page and come back the CheckBox isn't checked. The GridView is inside the UpdatePanel, could this be an obstacle here? If yes, how to modify the code to work inside the UpdatePanel?
modified on Monday, March 2, 2009 9:12 AM
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Right now, one works great, but if I have a second of the same type on the same page (pulling different data info). If I check the top box in either grid view, all boxes on both grid views fill in. I've tried changing the name and variables of the second java function, but still they control each other. Would I do something similar to the gentleman who has 3 columns of check boxes? Can you please show me? Thanks you so much...this is great stuff!
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
 | good  Member 2738246 | 23:33 27 Aug '08 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Hi i want to retrieve a loginid (integer) into a session, after a drop down box can be appeared in that i will store the name (varchar) of the members in the login table but the member who loin at that time it cannot be displayed(Session member).. plz clear my daught as soon as possible.. 
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
If we have paging in the same grid then we are unable to count the no. of checked checkboxes becuase the gridview.rows collection returns the rows of currentpageindex not all.
Any Solution?? Please help, thanks
modified on Friday, June 13, 2008 7:55 AM
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
I am using checkboxes in the GidView: grdFiles but the values of the check boxes are not shown as in the DB the following code is used to populate the Gridview:
romotionTableAdapters.vw_ApplicationFilesTableAdapter adapter = new romotionTableAdapters.vw_ApplicationFilesTableAdapter();
romotion.vw_ApplicationFilesDataTable table = adapter.GetDataByApplication(ApplicationID, RoleID));
grdFiles.DataSource = table; grdFiles.DataBind();
//table has one column with bit values for checking and unchecking checkboxes in the Gridview
Pls Help me  thanks in advance Shomaail
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I am inserting data into database by selecting checkbox in datagrid. But when same page is open,which checkboxes have seen seleced those should appear as checked according to specific condition.
Help me.
Thank you.
|
| Sign In·View Thread·PermaLink | 2.25/5 |
|
|
|
 |
|
 |
hi there, i did it but using code not javascripts
/*************************************************/
#region TODO: check/uncheck all CheckBox in GridView protected void Create_Status_CheckBox_All_CheckedChanged(object sender, EventArgs e) { bool checkState=false; if (((CheckBox)(sender)).Checked) checkState = true;
ToggleCheckState("Create_Status_CheckBox", checkState); }
protected void Update_Status_CheckBox_All_CheckedChanged(object sender, EventArgs e) { bool checkState = false; if (((CheckBox)(sender)).Checked) checkState = true;
ToggleCheckState("Update_Status_CheckBox", checkState); }
protected void Delete_Status_CheckBox_All_CheckedChanged(object sender, EventArgs e) { bool checkState = false; if (((CheckBox)(sender)).Checked) checkState = true;
ToggleCheckState("Delete_Status_CheckBox", checkState); }
private void ToggleCheckState(string CheckBoxID,bool checkState)//, GridView grid) { if (CheckBoxID == "") return;
// Iterate through the Products.Rows property try { foreach (GridViewRow row in FuncsGridView.Rows) { // Access the CheckBox CheckBox cb = (CheckBox)row.FindControl(CheckBoxID); if (cb != null) cb.Checked = checkState; } } catch (Exception ex) { return; } } #endregion /*************************************************/
and in the aspx (in gridview columns
/*****************************************************/
<asp:TemplateField HeaderText="Create" SortExpression="cb1data"> <asp:CheckBox ID="Create_Status_CheckBox" runat="server" Checked='<%# IsActive((string)(Eval("Create_Status"))) %>' /> <HeaderTemplate > <asp:CheckBox ID="Create_Status_CheckBox_All" AutoPostBack="true" Text="|Create|" runat="server" OnCheckedChanged="Create_Status_CheckBox_All_CheckedChanged" /> </HeaderTemplate> <HeaderStyle CssClass="from" HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Update" SortExpression="cb1data"> <asp:CheckBox ID="Update_Status_CheckBox" runat="server" Checked='<%# IsActive((string)(Eval("Update_Status"))) %>' /> <HeaderTemplate > <asp:CheckBox ID="Update_Status_CheckBox_All" AutoPostBack="true" Text="|Update|" runat="server" OnCheckedChanged="Update_Status_CheckBox_All_CheckedChanged" /> </HeaderTemplate> <HeaderStyle CssClass="from" HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Delete" SortExpression="cb1data"> <asp:CheckBox ID="Delete_Status_CheckBox" runat="server" Checked='<%# IsActive((string)(Eval("Delete_Status"))) %>' /> <HeaderTemplate > <asp:CheckBox ID="Delete_Status_CheckBox_All" AutoPostBack="true" Text="|Delete|" runat="server" OnCheckedChanged="Delete_Status_CheckBox_All_CheckedChanged" /> </HeaderTemplate> <HeaderStyle CssClass="from" HorizontalAlign="Left" /> /*****************************************************/
where the function IsActive is my owen function to return true or false /****************/ public bool IsActive(string asd) { if (asd == "Yes") return true; else if (asd == null) return false; else return false;
}
/****************/
and that is it, so anyone can provide javascript sol to enhance posting back ??
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Hi there, thanks a lot for this great topic. I've Q, if I've griview like this <img src="http://aycu22.webshots.com/image/35901/2003242605890244495_rs.jpg" />
and I want to check all in these 3 columns , so can you provide any help !! thanks in advance
|
| Sign In·View Thread·PermaLink | 1.50/5 |
|
|
|
 |
|
 |
Even wen I hav checked the check box it returns false.. I am pasting the code here....
Any help would be strongly appreciated.
I need it urgently guys..!!!
for (int i = 0; i < GridView1.Rows.Count; i++) { GridViewRow row = GridView1.Rows[i]; bool check= ((CheckBox)row.FindControl("chkselect")).Checked; if (check) { string str=GridView1.Rows[i].Cells[1].Text; Response.Write(str); }
}
Also the DataItemIndex is zero..
I dont know how to resolve the problem since i am a beginner in asp.net please help me out
Regards, Namrata.
-- modified at 5:43 Thursday 11th October, 2007
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
|
 |
|
 |
<script language="javascript" type="text/javascript"> function SelectAllCheckboxes(spanChk) { var oItem = spanChk.children; var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0]; xState=theBox.checked; elm=theBox.form.elements; for(i=0;i if(elm[i].type=="checkbox" && elm[i].id!=theBox.id) { if(elm[i].checked!=xState) elm[i].click(); } }
</script>
<HeaderTemplate> <input id="chkAll" önclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" /> </HeaderTemplate>
This Code Works Fine... But i got the Error in the line below... row.Cells[2].Text...
But i bugged all the errors and it works fine...
Thank You For this Article...!
Regards, UmayalDevi.R
-- modified at 1:46 Saturday 27th October, 2007
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Great , well done It makes problems with me as it return false even selected. the error was that I was bindding the gridview in each load i put this bindding in the event if (!Page.IsPostBack){GridView1.DataBind();} and its great. thanks a lot.
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
|
 |