2 Answers, 1 is accepted
0
eusouleon
Top achievements
Rank 1
answered on 11 Aug 2017, 10:44 PM
I just want it to show the details right away. No need click 'Details' dropdown button... anyone? thanks!
0
Hello Rene,
Thank you for writing.
Here is a sample code snippet demonstrating how to show the message details immediately after the RadMessageBox is shown:
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik
Thank you for writing.
Here is a sample code snippet demonstrating how to show the message details immediately after the RadMessageBox is shown:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
RadMessageBox.Instance.Shown -= Instance_Shown;
RadMessageBox.Instance.Shown += Instance_Shown;
RadMessageBox.Show(
"Message"
,
"Caption"
, MessageBoxButtons.OKCancel, RadMessageIcon.Info,
"Details"
);
}
private
void
Instance_Shown(
object
sender, EventArgs e)
{
MethodInfo mi =
typeof
(RadMessageBoxForm).GetMethod(
"ShowDetails"
, BindingFlags.NonPublic | BindingFlags.Instance);
mi.Invoke(RadMessageBox.Instance,
null
);
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Mark
commented on 13 Jun 2023, 11:53 AM
Top achievements
Rank 2
Bronze
Iron
Veteran
I have basically done as explained above, but my details pain never opens automatically.
MethodInfo mi = typeof(RadMessageBoxForm).GetMethod("ShowDetails", BindingFlags.NonPublic | BindingFlags.Instance);
Mark
commented on 13 Jun 2023, 12:06 PM
Top achievements
Rank 2
Bronze
Iron
Veteran
It looks as it has changed, I had to make change to the Event Handler. This is how I got it to work.
private void HandleRadMessageBoxInstanceShown(object sender, EventArgs e)
{
if (sender is RadMessageBoxForm mb)
{
if (!string.IsNullOrEmpty(mb.DetailsText))
{
mb.ShowDetails();
}
}
}
Dess | Tech Support Engineer, Principal
commented on 16 Jun 2023, 05:48 AM
Telerik team
Hi, Mark,
I am glad that you succeeded to get the message box working in the desired way. Indeed, there was in improvement during the 6 years versions gap and now the ShowDetails method is public.