Forms Data Controls :: Saving Radiobutton "state" On Manually Data Sourced GridView?

Aug 3, 2010

I want to use a radio button selection on a GridView. I can get this working with a regular DS. However, my table is manually DS'd. When the page frame holding the GridView is loaded, I trigger that event to fire off the subroutine that loads a DataTable and adds the DataTable to the DataSource of the Gridview.

The Gridview has a radio button in the first column as the "SELECTED ROW" appearance. Whenever I run the onchange event code for the radio button, I try and fix the radio buttons so only one row is selected with the following code:

[Code]....

This code works fine with the gridview if its got a built in SQLLDataSource. However, with my manual assigning of DataSourcing to the Gridview on Frame Load, I believe the gridview is being reinitialized everytime and I'm loosing the state of the radio button. I don't believe I can use the IsPostBack() because sometimes this frame and gridview will be showing sometimes it won't and yet other times it will need to be "recreated" with new data dynamically within the page. However, I tried to use PostBack and it looks like its working until I try and do a sort...than that crashes.

[Code]....

When I click on Sort, it crashes here

If (mydata.Rows.Count <> 0) Then

(its complaining about it being "null")

[Code]....

View 9 Replies


Similar Messages:

Forms Data Controls :: Store Radiobutton State In FormView

Mar 13, 2010

I have a FormView on my page and each ItemTemplate consists of 4 Radiobuttons. Now, let a user select a RadioButton, say r, on PageIndex, say p, and then moves to PageIndex k. When the user comes back to Index p, he should see the button r selected. I'm not able to do that. I have been able to save the radio button that was checked, but when the user goes back to the index, none of the buttons are checked. I've tried a lot of things like setting the button during PageIndexChanged, PageIndexChanging and PageLoad, but none worked.

View 4 Replies

Forms Data Controls :: Edit Or Update Data In Gridview Manually Without Auto Generate In C#?

Mar 12, 2010

how to edit data in grid view manually without auto generate in gridview + ajax.

View 4 Replies

Forms Data Controls :: Way To Add Manually Data To Gridview

Jan 8, 2010

I have tried a few different ways to add columns of data to a gridview. I have just about got success, except for I am having problems with only getting the last value in my array of data to insert into the gridview column. For example if I return 4 rows from an sql query, with the values of 2, 4, 6, 8. The last value (8) shows in all for rows of the gridview for that particular column.

View 8 Replies

Forms Data Controls :: Saving State With Nested Repeater Controls?

Feb 17, 2010

I have two repeaters (one nested in the other) with checkboxes for each. AutoPostback is set to true. ViewState is enabled. for the repeaters. The layout is similar to a treeview control.

I am having trouble retaining state for the child repeater's checkboxes when I check the parent repeater's checkboxes. How can I retain these child checkboxes as I click on the parent's.

View 1 Replies

Forms Data Controls :: Gridview Sort Manually With Button Outside Of Gridview?

Jan 18, 2011

I have a gridview with data. I want a button which is not part of the gridview. Then if I press a button the gridview is sorted by two colums. i.e column1 ascending column2 descending.

I am not looking to work with a Sqldatasource as I use a data access layer. So the sort would have to be from a datatable and databind or directly with the gridview.

View 3 Replies

Forms Data Controls :: Inserting A Row In Gridview Manually?

Jan 5, 2010

I want to insert an extra row in the gridview in the RowDataBound event (or another place if thats possible). How can I do that?

The data in the row to be inserted is not part of the resultset, but rather to split the gridview in logical sections.

View 19 Replies

Forms Data Controls :: Manually Filling A Gridview?

Sep 7, 2010

I don't want to databind a gridview, I want to be able to add rows myself within c# code. I can see there is a GridViewRow object and wondered if I can use this to add/remove rows as required?

View 5 Replies

Forms Data Controls :: Get The Value Of Radiobutton From Gridview?

Sep 5, 2010

I have Gridview with three server-side radio buttons in each row. How will I be able to get the value of the row of the selected radio button?

View 5 Replies

Forms Data Controls :: Radiobutton Does Not Appear In Gridview?

Sep 9, 2010

I'm building a data gridview with a column of radiobutton. I can get the data to bind to the grid but the radiobutton does not appear in the grid under the select column.

<a href="http://drop.io/3jb49ac/asset/grid-png" title="grid-png">View grid-png</a>

Below are the codes. What could be the problem?

[Code]....

View 3 Replies

Forms Data Controls :: Way To Update For A Manually Bound GridView

Mar 3, 2010

I am having a hard time updating from my gridview based the value that I am setting in the datakeynames it is the Ucc field I keep getting and index out of range exception on the e.keys[0]. I have done this before so I am confused what I am missing here.

View 8 Replies

Forms Data Controls :: How To Change Row Color Manually In Gridview

Nov 8, 2010

I m having a gridview and Next and Previous button below gridview. If I click on next, I want to highlight the next row.

If i click on Previous, I want to highlight the previous row.

View 2 Replies

Forms Data Controls :: How To Manually Call A Gridview Event

Jan 6, 2010

Example. I need to manually call the test_RowDataBound event.

[Code]....

I tried this as I've used with buttons in the past.

button1_click(this, EventArgs())

but it dosen't work

View 2 Replies

Forms Data Controls :: Manually Binding GridView With SQL Statement.?

Feb 9, 2010

I have a gridview that I am manually binding in my code behind page because I have to pull out information from other sources for the WHERE clause.The issue is that I get an error on the aspx page that one of the columns is not in the dataview, however when I run the SQL statement in SQL all the columns are there and there is not a spelling error.If I remove the column from the gridview then the page loads.I cannot see why the column is a problem.Here is my ASPX gridview code.

[Code...]

This is the line where the error occurs. <asp:Label ID="Label2" runat="server" Text='<%# Bind("date_submitted") %>'></asp:Label> Here is the code behind

[Code...]

Here is the ending SQL statement that works in SQL and does return the date_submitted column. SELECT id, title, date_submitted, (SELECT username FROM users WHERE (id = t.submitted_by_user_id)) AS submitted_by, (SELECT name FROM departments WHERE (id = t.department_id)) AS department FROM tickets AS t WHERE (closed_by_user_id IS NULL) AND (department_id = 48 OR t.department_id = 83) ORDER BY t.date_submitted DESC



View 2 Replies

Forms Data Controls :: Manually Add Items To Gridview With Sqldatasource?

Mar 22, 2011

Can you add a row of data programatically and bind it to the gridview? If so, how?

I have a grid with 2 columns. One of these columns is a template that runs a function and delivers an output. Within that function I need to manually add data that is not present in the sqldatasource to the grid and use it when performing aggregate functions.

ColumnA - ColumnB
1 - MyFunction(1) - adds new row (1, B)and returns A to column B.
2 - MyFunction(2) - May return just A

Grid should look like
1 - A
1 - B
2 - A

Even though SQLDataSource only returns
1 - AB
2 - A

View 1 Replies

Forms Data Controls :: Add Radiobutton List To Gridview?

Mar 15, 2011

I want to add 2 radiobuttons into a column:

- Present
- Absent

There is also a field in the database: 'Present'

I have googled his topic, most of the answers provide with the .aspx code.

I would like to do it from the 'Design' method, ie. from the Property box.

If the user select 'Absent' then a dropdown list have to be 'visible' on the next column for selection.

View 4 Replies

Forms Data Controls :: Gridview Or Listview & Radiobutton?

Oct 31, 2010

How to use radiobutton in gridview or listview to get selected value that meanhow to radiobutton work with Commandname or and other logic

View 11 Replies

Forms Data Controls :: Radiobutton Select On Gridview?

Jul 23, 2010

I need a Radio Button Select for my gridview which is manually datasourced (manual data set)

I copied this post but converted to vb.net [URL] However, its not working...so I'm not sure if its because I'm missing the conversion of some of the C# to vb.net or if I missing something else.

Heres my code.

[Code]....

View 15 Replies

Forms Data Controls :: Manually Fire A GridView ItemCommand Event?

Mar 19, 2010

I've got a GridView control with LinkButtons in different cells. Currently when someone clicks a link, it fires the ItemCommand passing the CommandName and the ID of the item the link is bound to. That all works fine. I need to modify it now to not use links anymore. It now needs to show a popup balloon with a link (styled to look like a button) and when the link is clicked, I want it to do the exact same thing. I'm sure there are several ways of doing this, but for time's and consistency's sake, I'm copying the method used from another page we have that is already doing this. It has a hidden DIV on the page with the link in it. When you hover over a link, javascript repositions the div and makes it visible.

So what I need to do is pass my CommandName and item ID to the javascript so that it can trigger the postback when they click that single link. I know this is not the only way to get to the end result, but what I want to do if possible, is still fire the GridView's ItemCommand and set he DataListCommandEventArgs' CommandName and CommandArgument properties. Can someone explain how, under normal circumstances, clicking the LinkButton in the GridView fires the ItemCommand? I know that the LinkButton's click event is forwarded to the GridView but what gets sent from the client side that let's the server know the link was clicked?

View 5 Replies

Forms Data Controls :: Saving Data From Dynamic Gridview Columns?

Mar 26, 2010

I have a gridview, where I set the columns based on the columns in a datatable. I have a class that implements ITemplate, and creates a textbox template field. Everything works good, I can display my grid with the correct columns and headers. The probem comes up when I click a Save button, to save the user input. Of course the page postbacks, and I re-create the columns on PageInit. However, all the data the user entered is gone.

View 2 Replies

Forms Data Controls :: Add RadioButton Column Into A Dynamic Gridview?

Mar 26, 2010

Does anyone knows how to add a radiobutton column into a dynamic gridview? The problem with the asp.net radiobutton is that in a grid view is not mutually exlusive so actually it would have to be a literal type= "radio "control, but how to add it when the gridview is created dynamially?

Also, once I have the radioButton set up correctly...how can I identified whether that row has the radiobutton checked or not?

View 5 Replies

Forms Data Controls :: RadioButton In GridView - How To Check/uncheck

Mar 17, 2011

I got a GridView and 2 columns have a radiobutton in each, named rbStatus.

1 coulmn header name Aired and other column named "Missed".

They are not databound.

How do I check the radio button in code behind?

Or should I make it databound?

The field to be displayed in the column "Aired" is boolean type.

If the "Aired" is not checked, I need to set the "Missed" checked.

[Code]....

View 4 Replies

Forms Data Controls :: TemplateField With RadioButton Inside A Gridview?

Jul 27, 2010

i have a website with a radiobutton inside a gridview, i set the groupname in the gridview but when i run the table, the radiobutton did not became exclusive or i can checked = true on all radiobutton. this is my code:

[Code]....

View 7 Replies

Forms Data Controls :: Defaut First Radiobutton Selected On Gridview?

Apr 8, 2010

Im codiing in asp.net in C#. I'm trying to select BY Default the first radiobutton value of my gridview.

This is my current code for my aspx page:

<%
@
Page
Title=""
Language="C#"
MasterPageFile="~/Site1.Master"
AutoEventWireup="true"
CodeBehind="merchantsearch.aspx.cs"
Inherits="Template1.RegistrationSummary" %>
<
<
asp:Content
ID="Content1"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">script
language="javascript"
type="text/javascript">

[Code]....

View 2 Replies

Forms Data Controls :: Radiobutton List & Gridview Boundfields?

Apr 1, 2010

One of the gridviews looks like this:

Q1 SQ1 A1
Q1 SQ1 A2
Q1 SQ1 A3
Q1 SQ2 A1
Q1 SQ2 A2
Q1 SQ2 A3

[Code]....

All fields are BoundFields (except radiobuttons). They can't be converted to templates, I am using boundfields for row-level displaying in RowDataBound.Each row has a radiobutton and only one radio button should be selected per subquestion (SQ).How I can ensure only one answer is selected per subquestion? On radiobutton click or on submit?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved