Hi there,
My objective is trying to add new record to gridview via radgridview footer ( GridViewDataColumn.Footer and GridViewComboBoxColumn.Footer ) by added Textbox , Datepicker , Combobox to those columns footer.
How to get input values from those footer to use in code behind ?
give me some advice please ...
ps.my constraint are GridView.IsReadOnly = true , ShowInsertRow = false
looking for your response
Regards,
SweNz
My objective is trying to add new record to gridview via radgridview footer ( GridViewDataColumn.Footer and GridViewComboBoxColumn.Footer ) by added Textbox , Datepicker , Combobox to those columns footer.
How to get input values from those footer to use in code behind ?
give me some advice please ...
ps.my constraint are GridView.IsReadOnly = true , ShowInsertRow = false
looking for your response
Regards,
SweNz
6 Answers, 1 is accepted
0

SweNz
Top achievements
Rank 1
answered on 14 Jan 2011, 10:00 PM
my issue solved ( temporary )
my temporary solution is get value by find from control name. Is anyway else ?
Regards,
SweNz
Obj a =
new
RemarkObj();
a.date = (DateTime) ((RadDatePicker)ctlGridView.FindName(
"ctlDatePicker"
)).SelectedDate;
a.m = ((TextBox)ctlGridView.FindName(
"ctlTxt"
)).Text;
a.item = ((RadComboBox)ctlGridView.FindName(
"ctlCombobox"
)).Text;
my temporary solution is get value by find from control name. Is anyway else ?
Regards,
SweNz
0
Accepted
Hi SweNz,
Greetings,
Maya
the Telerik team
You may access the elements defined in the column footers directly through their names:
XAML:
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
>
<
telerik:GridViewDataColumn.Footer
>
<
TextBox
x:Name
=
"NameTextBox"
/>
</
telerik:GridViewDataColumn.Footer
>
</
telerik:GridViewDataColumn
>
C#:
var myText = this.NameTextBox.Text;
Greetings,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0

SweNz
Top achievements
Rank 1
answered on 17 Jan 2011, 08:56 AM
Hi Maya,
Thanks a lot
Cheers,
SweNz
Thanks a lot
Cheers,
SweNz
0

Viki
Top achievements
Rank 1
answered on 12 May 2011, 12:53 PM
Hi Maya,
I did as you wrote, but when I accessed to the TextBox, it was null, though I set the Text of the TextBox in XAML and I do see the Text on the Grid
in XAML:
in C#:
Can you advise something?
Thanks,
Viki
I did as you wrote, but when I accessed to the TextBox, it was null, though I set the Text of the TextBox in XAML and I do see the Text on the Grid
in XAML:
<
telerikGrid:GridViewDataColumn.Footer
>
<
TextBox
x:Name
=
"txtFooter"
Text
=
"Hello"/
>
</
telerikGrid:GridViewDataColumn.Footer
>
in C#:
string test = txtFooter.Text;
Can you advise something?
Thanks,
Viki
0
Hello Viki,
Maya
the Telerik team
In order to provide you with a suitable solution, I would need a bit more details. What is the exact scenario that you want to accomplish ? Do you want to define something specific in it ? When are you trying to get the corresponding TextBox ? May you try to access the GridViewFooterCell for example ?
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Viki
Top achievements
Rank 1
answered on 15 May 2011, 07:08 AM
Hi,
Actually, I need to set the column's footer to some value from the code, so when I saw your post, I thought that it can be suitable to me, but when I tried in the code (C#) to access to the Text Box of the footer, I saw that it's null.
I gave some value to it in XAML (as in my previous post), and I could see it on the GridView on UI, but in the code it still was null and any try to get or set its text, causes the "Object reference not set to an instance of an object" error.
Thanks,
Viki
Actually, I need to set the column's footer to some value from the code, so when I saw your post, I thought that it can be suitable to me, but when I tried in the code (C#) to access to the Text Box of the footer, I saw that it's null.
I gave some value to it in XAML (as in my previous post), and I could see it on the GridView on UI, but in the code it still was null and any try to get or set its text, causes the "Object reference not set to an instance of an object" error.
Thanks,
Viki