|
Thank you so much for your reply. I understand what you mean and it is working perfect when I put in the row and column numbers but my problem is I don't know which row the user would select. The data is read form a database and I put a radio button beside all rows. I want the user select the row from the radio button and click on a button after that the information on that row would be shown in appropiate textboxes.
I am really stuck on that and I would really appriciate your help.
Thanks
|
|
|
|
|
Try this, you go through each row in the GridView looking for the one with the selected radio button and break out when you find it.
<br />
foreach (GridViewRow gvr in gvYourGridView.Rows)<br />
{<br />
if (((RadioButton)gvr.FindControl("rbYourRadioButton")).Checked)<br />
{<br />
<br />
break; <br />
}<br />
}<br />
-- modified at 17:55 Tuesday 27th June, 2006
EDIT: .Checked not .Selected
|
|
|
|
|
Great! Thank you so much, I really appriciate it.
Cheers
|
|
|
|
|
Let say I have 2 methods:
void BeginGroup();
void BeginGroup(string msg);
when I want to refer to them I write
/// <see cref="BeginGroup"/>
But this cause a compiler warning, where my declaration is ambiguous (between the 2 BeginGroup methods).
But what if I want to refer them both?
In much the same way as when you click on "Console.WriteLine" and you go to the page which lists all the possible polymorphic variations?
|
|
|
|
|
My main form can open multiple non-modal child windows (FormBorderStyle.FixedToolWindow, Owner set to the main form).
The main form has a MainMenuStrip with items that have shortcuts (e.g. Ctrl+F for "find", Ctrl+R for "replace"). But inside the "find" dialog, pressing Ctrl+R has no effect (well, it plays a beeping sound...).
How can I send the key presses to the MainMenuStrip? I want to forward only those key presses that are not handled by the child window.
|
|
|
|
|
Hello
I think this would be a simple task -Even though I don't think I like the idea-
Simply -I suppose- you have your KeyUp event handlers in your child forms. When they catch a key that should be passed to the parent they should call a public method to your main From.
eg.
ChildFormKeyDownHandler(EventArgs e)
{
//Handle my keys
//...
//...
if(e.Key == somekey)
{
myParent.PublicMethod();
}
}
While sending the keys themselves to the parent form won't gain you anything.
Yet if you still insist on this try looking for "SendKeys" class in your MSDN
|
|
|
|
|
I cannot use SendKeys because I don't want to change focus to the main window.
And thanks, I know how to call public methods on other forms, but I did not find a way to call shortcuts in a MainMenuStrip.
I don't want to write the code searching the correct item for the shortcut myself because the main menu can be extended by AddIns in different ways.
|
|
|
|
|
Hello again
I didn't mean to offend you in any way, yet just like I said, what is the point of calling a shortcut of a form that's not active!! Anyway I'm just trying to help here.
Three hints:
1- You can activate the parent form, do the SendKeys, then reactivate the last active child form
2- You can import an old API function named "SendMessage" or "PostMessage", tyhen use your parent's Handle to send a WM_KeyDown message.
3- You can make the parent's event handlers call public methods, and call them from the child froms
Or you can just check this link, it might help
http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp[^]
Sorry it's C++;)
That was all I could come up with. I hope it would be of some use.
|
|
|
|
|
How can I do that?
I'm experimenting exceptions when trying to save an xml document with the XmlDocument object in a web service.
Thanx for any help.
|
|
|
|
|
What exceptions?
---
b { font-weight: normal; }
|
|
|
|
|
Excepción no controlada del tipo 'System.Web.Services.Protocols.SoapException' en system.web.services.dll
Additional info: System.Web.Services.Protocols.SoapException: Server cannot process request. ---> System.UnauthorizedAccessException: Access denied to path "D:\Uni\Proyecto\DatosSI0506\Configuracion\Config.xml".
I've translated some of the text.
I've tried a bunch of things and none work. I even tried to delete the file first, so it can save it correctly without overwriting, but it's useless. It doesn't let me delete.
|
|
|
|
|
Is the file located in the web folder? If not, then you might need to grant access to it for the user account running the web service. Usually it's the IIS_WPG or ASPNET account.
---
b { font-weight: normal; }
|
|
|
|
|
It's not in the web folder. How can I grant access with XP Pro SP2?
If not, moving the file to the web folder does the trick? What path should I use then? Maybe C:\Inetpub\wwwroot\...?
|
|
|
|
|
sergestusxx wrote: How can I grant access
Open the properties for the file or the folder and go to the security tab. Add the user account to the list if it's not there. Set write permission for the user account.
sergestusxx wrote: If not, moving the file to the web folder does the trick? What path should I use then?
Any folder above the web root would probably do. Start by putting it in the same folder as the web service, that has the best chances to work.
---
b { font-weight: normal; }
|
|
|
|
|
In my Windows XP Pro SP2 I don't have any security tab like in W2000 O_o
|
|
|
|
|
That's because you still have simple file sharing enabled.
In explorer:
Tools > Folder Options > View
Uncheck "Use simple file sharing".
---
b { font-weight: normal; }
|
|
|
|
|
how to create databse through the sql script. simple copy the text from the script file or do any thing extra.
Tasleem Arif
|
|
|
|
|
I just converted from visual studio 2003 to visual studio 2005. The project I am working on has several forms that are inherited from each other, each form added some additional items to the menu of its base form. This worked fine before with vs 2003, but now when editing an inherited form's menu I get a message box that says "Cannot add a new item to this menu because it is inherited." The menu is declared as protected. Can anyone explain what is going on?
Thanks
Karl
|
|
|
|
|
I have a 2 levels of treeview. How do I highlight the child node (2nd level), instead of the parent node, so that the user would know which child node has been selected?
|
|
|
|
|
|
How do I make a panel on a tabpage highlightable so that whatever text on it can be highlighted?
|
|
|
|
|
I've have an annoying iss when trying to print a page in Windows form.
printDocument1.DefaultPageSettings.Landscape = true;
This sets the page to landscape no problem, but when I try to get the PrintableArea it is still in Portrait mode (800x1100) rather than Landscape (1100x800). I've worked around this, but it is annoying, I would expect the PrintableArea to update appropriately.
Does anyone have an explaination or a way to get the settings properly? Did I miss something?
|
|
|
|
|
Hello
Well, we don't have your entire code to look at, but why don't you try using the PrintPageEventArgs.MarginBounds Property instead?
NB.
If you try to change the Landscape property inside the PrintPage event it won't work!!! I geuss you already know that.
|
|
|
|
|
MarginBounds is different from PrintableArea, but thanks for the response. It also has nothing to do with the code but here you go
<br />
private void OnPrint(object sender, EventArgs e)<br />
{<br />
printDocument1.DefaultPageSettings.Landscape = true;<br />
}<br />
<br />
private void OnPrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
e.Graphics.DrawRectangle(new Pen(Color.Red), e.PageBounds);<br />
e.Graphics.DrawRectangle(new Pen(Color.Yellow), e.MarginBounds);<br />
e.Graphics.DrawRectangle(new Pen(Color.Black), e.PageSettings.PrintableArea);<br />
}
The last is what annoys me, I would expect it to in landscape by it is still in portrait.
-- modified at 11:36 Tuesday 27th June, 2006
|
|
|
|
|
Hello
I can see now your problem. I know that printablearea is not updated, that's why I purposed using MarginBounds instead.
Well, if you insist, try inverting them -ie using height as width and vice versa-, but I think this would be a very poor programming practice
a quote from MSDN remarks on PrintableArea:
"The PrintableArea property returns the correct value, whether the page orientation is landscape or portrait."
Do they mean it's changed when you change the Landscape property, or it doesn't matter?? I made a sample and changed the landscape property, but it was the same
I even changed the PaperSize, yet no hope.
Well, I hope this was -somehow- helpful
|
|
|
|