hi,
i want to add a custom attribute to radgrid and this attribute must shown on source of grid html.. is it possible?
for example;
<div id="RadGrid1" class="RadGrid RadGrid_Office2007" myAttribute="someAttributeValue" >
.... other grid html on page.....
</div>
thanks in advance..
i want to add a custom attribute to radgrid and this attribute must shown on source of grid html.. is it possible?
for example;
<div id="RadGrid1" class="RadGrid RadGrid_Office2007" myAttribute="someAttributeValue" >
.... other grid html on page.....
</div>
thanks in advance..
4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 02 Mar 2009, 09:18 AM
Hello,
You can try out the following code to add a custom attribute to your grid:
cs:
Thanks
Princy.
You can try out the following code to add a custom attribute to your grid:
cs:
| protected void Page_Load(object sender, EventArgs e) |
| { |
| RadGrid1.Attributes.Add("customAttribute", "customvalue"); |
| } |
Thanks
Princy.
0
Sylvie
Top achievements
Rank 1
answered on 20 May 2013, 02:50 PM
Hi,
How to get custom attributes added to RadGrid during aspx Page_Load() method? I want to get custom attributes on client side using JavaScript.
For example
//Add custom attributes to RadGrid control on server side (c#)
rgPivotGrid.Attributes.Add("pivotDeletedRows", "");
I cannot get the added custom attribute from JavaScript. It gives error
var deletedRows = pivotGridControl.getAttribute("pivotDeletedRows");
Thanks,
Ritesh
How to get custom attributes added to RadGrid during aspx Page_Load() method? I want to get custom attributes on client side using JavaScript.
For example
//Add custom attributes to RadGrid control on server side (c#)
rgPivotGrid.Attributes.Add("pivotDeletedRows", "");
I cannot get the added custom attribute from JavaScript. It gives error
var deletedRows = pivotGridControl.getAttribute("pivotDeletedRows");
Thanks,
Ritesh
0
Hello,
In order to achieve your scenario you could use the code provided below. The idea is to access the html element from the RadPivotGrid client-side object by using the get_element function and then get the attribute value.
Regards,
Antonio Stoilkov
Telerik
In order to achieve your scenario you could use the code provided below. The idea is to access the html element from the RadPivotGrid client-side object by using the get_element function and then get the attribute value.
var deletedRows = pivotGridControl.get_element().getAttribute("pivotDeletedRows");Regards,
Antonio Stoilkov
Telerik
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
Sylvie
Top achievements
Rank 1
answered on 31 May 2013, 08:38 PM
Thanks Antonio. It works.