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

Rad Grid Edit

2 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naveen kumar
Top achievements
Rank 1
Naveen kumar asked on 09 Jan 2012, 09:51 AM

When i click Edit Button in the radgrid and after edit is done when i click the Update or save button the system will check the list of existing tags to make sure the edited tag name does not already exist. This check will look at the exact name of all existing tags for that client and NOT be case sensitive. 

If the edit being saved already exists, then a message will appear in red next to the tag name that says “The name you are trying to use already exists.  No change has been made to your tag name.”  The tag they tried to edit will still be in the tag list but with the original name.

How to do This?

2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 09 Jan 2012, 10:58 AM
Hello Naveen,

protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
 
        bool IsTagNameAlreadyExists = false;
 
        // check Tag name is exist or not.
 
        if (IsTagNameAlreadyExists)
        {
            ((e.Item as GridEditableItem).FindControl("Label1") as Label).Text = "Name Already Exists";
            ((e.Item as GridEditableItem).FindControl("Label1") as Label).ForeColor = System.Drawing.Color.Red;
 
            e.Canceled = true; // cancel the update event
        }
        else
        {
            ((e.Item as GridEditableItem).FindControl("Label1") as Label).Text = "";
            ((e.Item as GridEditableItem).FindControl("Label1") as Label).ForeColor = System.Drawing.Color.Black;
            // save your record in to db
        }
    }


Thanks,
Jayesh Goyani
0
Naveen kumar
Top achievements
Rank 1
answered on 10 Jan 2012, 10:20 AM
Hi Jayesh Goyani,

How to do the bold thing ,

If the user has permission to DELETE tags, then to the left of the tag name will be an edit icon.  Once clicked “cancel” will appear under the tag name and a <-> button will appear to the right of the row.

When the delete button is clicked, a warning message will appear under the tag saying “By deleting, this tag will no longer be associated with any sub-sites across the organization and it will be removed permanently from the list of tags.  Please confirm that you wish to continue with this action by clicking on the delete button again. ”

If the user clicks on the <-> button, then the tag will be deleted from the client list and remove it from all sub-sites in which it was currently associated.  Clicking on “cancel” will leave the tag and keep it associated with the sub-sites it was assigned.
Tags
Grid
Asked by
Naveen kumar
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Naveen kumar
Top achievements
Rank 1
Share this question
or