TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
K S Reddi Prasad
NA
28
75.3k
How to disable a dynamic button in C#.net
Apr 20 2011 9:04 AM
Hi all,
I am generating buttons in a VSTO Ribbon dynamically from the xml data. Now, I want to disable a button on a condition. Every thing seems to be correctly, but i dont know why that button is not disabling. Plz refer the following code.
if (docProp["IsSubmittedTDL"].Value.ToString().Equals("True"))
{
//
After Loading the Xml file
XmlNodeList groupsList = xmlDoc.DocumentElement.SelectNodes("//DocumentGenerator/Groups/Group");
foreach (XmlNode group in groupsList)
{
bool iterate = true;
rGroup = new RibbonGroup();
XmlNodeList buttonElements = group.SelectNodes("Buttons");
foreach (XmlNode buttonList in buttonElements)
{
XmlNodeList buttons = buttonList.SelectNodes("Button");
foreach (XmlNode button in buttons)
{
rButton = new RibbonButton();
rButton.Name = button.SelectSingleNode("ButtonId").InnerText;
if (rButton.Name == "btnSubmit")
{
//Catch the SubmitButton and make it disable.
rButton.Enabled = false;
iterate = false;
break;
}
}
}
if (iterate == false)
break;
}
Any help will be greatly appreciated.
Thanks,
K.S.R Prasad
Reply
Answers (
3
)
How to read a pdf page count form a zip file without unzipping it
View only one method?