I am trialing RadDesktopAlert for a new system I am developing, and considering purchasing radcontrol for WinForms. I have used RadControls for the web before.
I have created a RadDesktopAlert and it appears to work quit well. I create the RadDesktopAlert in code and added 2 buttons behind it. I can run code from those buttons without any issues. However I need to pass an ID into the RadDesktopAlert , that I can access when pressing these buttons.
Is there a way I can pass a variable, does as a unique string into the RadDesktopAlert that I can read when pressing one of these buttons?
Many Thanks
private void rbeRequest_Click(object sender, EventArgs e)
{
Console.WriteLine("code test here");
// I need to get a value specific to the rad alert here.
}
// create the RadDesktopAlert
RadDesktopAlert radDA = new RadDesktopAlert();
//declare the buttons.
RadButtonElement rbeRequest = new RadButtonElement();
RadButtonElement rbeAdministrator = new RadButtonElement();
rbeRequest.Name = "test1";
//assign code to each button that runs.
rbeRequest.Click += rbeRequest_Click;
rbeAdministrator.Click += rbeAdministrator_Click;
//set padding around the buttons to make them a little bigger.
rbeAdministrator.Padding = new System.Windows.Forms.Padding(5);
rbeRequest.Padding = new System.Windows.Forms.Padding(5);
//apply a lable to the buttons
rbeAdministrator.Text = "My Administrator is Present";
rbeRequest.Text = "Request Permission";
//add the buttons to the DesktopAlert component.
radDA.ButtonItems.AddRange(new Telerik.WinControls.RadItem[] {
rbeRequest,
rbeAdministrator});
}
//apply text.
radDA.CaptionText = "caption text goes here";
radDA.ContentText = "content text goes here" ;
//show the alert.
radDA.Show();
}