Tech Off Thread

3 posts

Datagrid Navigation?

Back to Forum: Tech Off
  • User profile image
    venkatzeus

    Hi..

     I have a web application, in which i have a r.a.d datagrid. I also have 2 textboxes for the user to enter. I have enabled paging in the r.a.d datagrid. I have 2 buttons( New and Cancel).

    If the user is clicking the New Button and if the user tries to navigate to the next page, i want to pop a message to the user. Ie, if the user has clicked the button, then page navigation should not be enabled.

    How to do this? Please help

  • User profile image
    TrainingTime

    You need to use button1.attributes.add("onClick", "Javascript code goes here") in the codebehind.

    There's a good tutorial for this here: http://aspnet.4guysfromrolla.com/articles/021104-1.aspx

  • User profile image
    roverfan

    If you are talking about RadGrid offered by Telerik corporation, there might be an quicker way to do what you are up to. I say it because I have played with their web grid a while ago (while working for my previous employer Tongue Out) and gained some knowledge on the product. 

    Do you plan to insert a new record when hitting the New button? If so, just intercept the PageIndexChanged event in the code-behind, check whether e.Item.OwnerTableView.IsItemInserted returns true and cancel the page action by setting e.Cancelled = true. After that, to notify the user that the operation was aborted, add the user message to the ResponseScripts collection of the grid object.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.