This is a migrated thread and some comments may be shown as answers.

Manual Edit checkbox not in Hashtable

2 Answers 71 Views
ListView
This is a migrated thread and some comments may be shown as answers.
moegal
Top achievements
Rank 1
moegal asked on 15 May 2013, 10:38 AM
I would like to do a manual edit of a listview.

I am looking at the Hashtable values and I do not see my checkbox key/value pairs.

I have a checkbox field in the EditITemTemplate called getsMail. I am just displaying the values in a literal for now. textboxes and comboboxes show fine. But I need the checkbox values.

protected void RadListView1_ItemUpdating(object sender, RadListViewCommandEventArgs e)
    {
        RadListViewEditableItem editedItem = (RadListViewEditableItem)e.ListViewItem;
        Hashtable newValues = new Hashtable();
        editedItem.ExtractValues(newValues);
 
        StringBuilder sb = new StringBuilder();
        foreach (DictionaryEntry entry in newValues)
        {
            sb.Append("key: " +entry.Key + " Val: " + entry.Value);
        }
 
        Literal1.Text = sb.ToString();       
    }
 
thanks, Marty

2 Answers, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 20 May 2013, 11:00 AM
Hi Marty,

You can access the text box and its value using the following:
RadTextBox txt = e.ListViewItem.FindControl("RadTextBox1") as RadTextBox;


Kind regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
moegal
Top achievements
Rank 1
answered on 21 May 2013, 09:30 AM
Maria,

I marked the answer as correct.  But, maybe the documentation should be changed so show this method for inserting and/or editing  listview and not the hashtable that does not seem to work for all controls.

the hastable did not return values for checkboxes or password fields. Other i would suspect as well.

I wasted several hours.

Thanks, Marty

Tags
ListView
Asked by
moegal
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
moegal
Top achievements
Rank 1
Share this question
or