iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have tried adding an attribute to the grid in the Load_Page method of the page as follows:
grid.Attributes.Add("data-customattribute", "value");
However, when the page is rendered, the attribute is nowhere to be found. Are you specifically preventing custom attributes from being created and attached to the grid? Is there another way I can create a custom attribute on the grid?
I've noticed that this functionality seems possible at the row and cell level, however it doesn't seem possible for the actual grid.
Should I be adding the attributes to a child element of the grid? If so, can you give a code example?
Hi,
To resolve this matter, you can put the attributes in WebGridCells' CustomAttributes. However with the code that you used before, the attributes can only be accessed in server side because it won't be rendered in client-side. Just like you though, the attributes that you put in server-side won't be rendered in client-side. Here's the walkthrough how to put the value inside WebGridCell level:
http://www.intersoftpt.com/Support/WebGrid/KB/Use-more-than-one-hidden-field-in-both-server-and-client-side-of-WebGrid/
Although, if you only want to use single custom attribute, it will be better if you're using HiddenField that contains string of your customAttributes. Is there any scenario that you want to achieve regarding this custom attributes? Look forward to hear any feedback from you so I can help you further.
Regards,Bernard
What I want to do is be able to set a customer html attribute to the root element in the grid.
<div data-customattribute="...">
This div being the root element for the grid
</div>
This would allow me to set my own custom attributes that I would use in other clientside scripts that I use throughout my application.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname