|
hi
I have a datagrid with a two colums. In the first column I have a checkbox in the header (headertemplate) and one for every row(ItemTemplate).
I find the checkbox in the itemtemplate easy with
<br />
cb = (CheckBox) dgi.Cells[0].Controls[1];<br />
but I cant seem to find the checkbox in the header. Ive also tried
<br />
cb = (CheckBox) this.dgOrganisation.FindControl("cbxAlla");<br />
with no results.
How do I find the checkbox?
|
|
|
|
|
Here is one solution:
foreach(DataGridItem dgi in dgOrganisation.Items)
{
if (dgi.ItemType == ListItemType.Header)
{
CheckBox cb = (CheckBox)dgi.Cells[0].Controls[1];
}
}
Haven't tried it out, but it'll do the trick
Hope it helps
Thomas
|
|
|
|
|
Hello, coders, I have a big question. I am gonna make a cd presentation with password protected sections but all my facilities will not have sence if the user browses the cd directory and opens the files there. So is there such a way to forbid browsing the directory in the cd?
|
|
|
|
|
No.
You might be able to mark the directory as hidden and system, then the users with default settings in the explorer won't see it.
You could encrypt the contents of the files. There is build in encryption in the framework.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I want to call a webservice Asynchronously. I know using the Callback mechanism of .NET we can do it.For that we have to add web service in webreference.
But in my application i will not add any Webreference instead i will call webservices through my ForwardRequest method with parameters of webserviceURL,username,password.Here is my code.
public static XmlNode ForwardRequest(string webRequest, string userName, string password)
{
XmlNode resultNode = null;
try
{
WebResponse result = null;
XmlDocument webdoc = new XmlDocument();
string url = "";
string payload = "";
if (webRequest.IndexOf('?') != -1)
{
url = webRequest.Substring(0, webRequest.IndexOf('?'));
payload = webRequest.Substring(webRequest.IndexOf('?') + 1);
}
else
url = webRequest;
WebRequest req = WebRequest.Create(url);
req.Credentials = new NetworkCredential(userName, password);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
byte[] SomeBytes = null;
if (payload != null)
{
SomeBytes = Encoding.UTF8.GetBytes(payload);
req.ContentLength = SomeBytes.Length;
Stream newStream = req.GetRequestStream();
newStream.Write(SomeBytes, 0, SomeBytes.Length);
newStream.Close();
}
else
{
req.ContentLength = 0;
}
req.Timeout = Timeout.Infinite;
result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
webdoc.Load(ReceiveStream);
result.Close();
resultNode = webdoc.DocumentElement;
}
catch (Exception e)
{
}
return resultNode;
}
My question is how should i call webservice Asynchronously with my ForwardRequest(). Can anybody knows how to add callback mechanism of .NET to my ForwardRequest()
Thanks,
Vinoth
|
|
|
|
|
Here is a dotnet Project renamer for c# and VB.NET
http://www.soft4people.net/projectRenamer
and it is free;P...
|
|
|
|
|
Cheap-ass...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi to all,
i'm trying to execute a stored procedure via a web service.
i want to send a struct that contains the parameter of the stored procedure
public struct StoredProcParam
{
public string eParamName;
public SqlDbType eType;
public int eSize;
public ParameterDirection eDirection;
public object eValue;
}
when i create in my windows application an instance of the struct, i can't assign the element of the struct because the debugger consider the element as invalid
localhost.StoredProcParam[] oParam = new localhost.StoredProcParam[3];
oParam[0].eParamName = "@sNomChamp";
oParam[0].eType = localhost.SqlDbType.VarChar;
oParam[0].eSize = 50;
oParam[0].eDirection = localhost.ParameterDirection.Input;
oParam[0].eValue = e.FieldName;
moclsBdd.ExecuteStoredProcedure("sp_UpdatePays", oParam);
does any know how to put values in the elements of the struct and then pass it to the web method in the web service
thanks in advance
fady
|
|
|
|
|
You have to create the structures also:
localhost.StoredProcParam[] oParam = new localhost.StoredProcParam[3];<br />
oParam[0] = new StoredProcParam();<br />
oParam[1] = new StoredProcParam();<br />
oParam[2] = new StoredProcParam();
---
b { font-weight: normal; }
|
|
|
|
|
thanks a lot for your reply, it works very good.
i were badly stuck with this issue
thanks again,
fady
|
|
|
|
|
Hi and thanks to your reply, it works very good
i was badly stuck with this issue
thanks again
fady
|
|
|
|
|
Can i add a reference to them and include the Dll's with the app?
If so does anybody know exactly what dll's 'n' stuff that i will need?
Update: the message says "File or assembly name Microsoft.DirectX, or one of its dependencies, was not found."
|
|
|
|
|
That depends on which .DLL's your talking about. The DirectX .DLL's will have to be installed using the Redistributable installer. The Managed DirectX Interop .DLL's you can include with your app. These are the .DLL's you should be setting your reference to. You haven't done this judging by the error message you posted.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
|
Hello,
Is there a way to show an MDIChild form modally?
Thank you very much
|
|
|
|
|
No. MDI Child forms are not meant for this purpose.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So if my MDIChild window open, how can I make shure they don't click
on the menu, etc.. without disabling it. So to make it the same
way as when you trying to click away in the modal form and it makes this
"Ding" sound?
Thank you
|
|
|
|
|
zaboboa wrote:
how can I make shure they don't click
on the menu, etc.. without disabling it.
"menu, etc, ..." of what? Your explanation isn't very clear at all.
An MDI Child window is a Multiple DOCUMENT Interface window. It's meant to edit documents, like having multiple editing windows open in Word, each editing a different document. It's not meant to be a modal window for anything.
I don't get why your MDI Child window has to be modal. I can't think of a single reason why you would want to do this.
What are you trying to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
you can't make it a modal but you can play a trick like I did. Do not make it a MdiChild. Set its ShowInTaskBar to false.. open it modally.. (ShowDialog) that will do exactly what you want..
Regards
|
|
|
|
|
how do i map tablestyle to dataview? ..its easy with dataset table names,
or how do i fill dataset table with dataview..
bye
|
|
|
|
|
Hello all,
I have a winform which I want to hide just after the InitializeComponent method is called.
I tried using Hide() to no avail.
Any insights?
Thanks.
Alberto Bar-Noy
Software Engineer
http://www.certagon.com
|
|
|
|
|
Override the form's OnLoad procedure and change the Opacity to 0.0. You can't really Hide() or use Visible = false to do this. WHen you need to show the form again, change the Opacity back to 1.0.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When Application.Run(myForm) is called, myForm is made visible. By this point the form has already been created and therefore its constructor and the InitializeComponent() method have already been called.
Use Application.Run() instead of Application.Run(myForm). This will start the message loop without making any form visible. You will likely then want to add Application.ExitThread() to an event handler for the Closed event of your main form.
-Chris
|
|
|
|
|
Hi,
I can open a MSWord document from C# code, but
is it possible to automate a Word document that is
not opened from the C# code ?(i.e. the Word document
is already opened before the c# code run ) If yes, how ?
Thanks
|
|
|
|