|
Hello,
Is there a way to see the column headers in datagrid at design time (Design Window).
Thank you.
|
|
|
|
|
Drag DataSet from the toolbar into the designer. Create DataTable and DataColumn etc using the PropertySheet. Drag a DataGrid Set the DataSource of the Grid to the DataSet and you will see the columns in the designer.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thank you.
By the way, do you know how to format the decimal output to only 4 decimal points?
If I have:
decimal totalArea = (NetRes * DevRes);
how do I format totalArea to have 4 decimal points?
Thank you.
|
|
|
|
|
I think I had posted this earlier to your similar question
Anyway never mind.
// Create a NumberFormatInfo object and set several of its
// properties that apply to numbers.
NumberFormatInfo provider = new NumberFormatInfo( );
string formatter = "{0,22} {1}";
// These properties will affect the conversion.
provider.NegativeSign = "minus ";
provider.NumberDecimalSeparator = " point ";
// These properties will not be applied.
provider.NumberDecimalDigits = 4;
provider.NumberGroupSeparator = ".";
provider.NumberGroupSizes = new int[ ] { 3 };
Convert.ToString( ObjDouble, provider ) );
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thank you.
I guess I never saw your other post.
|
|
|
|
|
I have problem about WebBrowser.
When program open webpage http://racing.ustrotting.com/entries.cfm and click button view already.
It's not save webpage after click button view but it's save before click button.
How to do it to save after click button view ?
Best regards
public void savewebpage(AxSHDocVw.AxWebBrowser axWebBrowser1,string strfile)
{
IHTMLDocument2 doc = (IHTMLDocument2) axWebBrowser1.Document;
UCOMIPersistFile pf = (UCOMIPersistFile) doc;
pf.Save(@strfile,true);
}
public void GetMainPage(AxSHDocVw.AxWebBrowser axWebBrowser1,
ref string strfile,string htmlpath)
{
System.Object nullObject = 0;
string str = "";
System.Object nullObjStr = str;
axWebBrowser1.Navigate("http://racing.ustrotting.com/entries.cfm",
ref nullObject, ref nullObjStr,ref nullObjStr, ref nullObjStr);
while (axWebBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
{
Application.DoEvents();
}
switch(Task)
{
case 1:
HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
HTMLInputElement btnView =
(HTMLInputElement) myDoc.all.item("Submit", 0);
btnView.click();
Task++;
break;
case 2:
break;
}
savewebpage(axWebBrowser1,"c:\\myWeb.html");
}
Best regards
tery
|
|
|
|
|
I used the dashes in order to prevent the browser from converting it to
XML characters outside the valid ranges are encoded as '' + (a hex number) + ';'. When I try to read characters from a CDATA section using an XmlTextReader I get the string '' + (a hex number) + ';' instead of a sinlge character. What am I doing wrong?
|
|
|
|
|
I have a 4*4 matrix which I wana rotate 90 degree.
Any suggestions please
|
|
|
|
|
Loop through the dimensions and copy the values to a new matrix.
for (i=0; i<4; i++)<br />
for (j=0; j<4; j++)<br />
newmatrix[i][j] = matrix[j][3-i];
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I try to get all TextBox Elements in a loop where the value is not null.
GroupBox, Label, button.. all will be found. But no TextBox. I think some Code says more...
foreach(Control ctl in this.Controls)
{
if(ctl is TextBox)
{
if(ctl.Text == "")
{
}
else
{
Statement;
}
}
}
|
|
|
|
|
Use this code
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(System.Windows.Forms.TextBox))
{
TextBox txt = (TextBox) c;
if (txt.Text == "")
{
txt.Text = "Found me..";
}
}
}
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
i'm working on visual source safe. Untill today the codes were working fine. But today when i wanted to compile the code it showed error-
"A failure occurred while attempting to start the compilation"
As in MSDN, it askes me to restart visual studio , which i did, but the error remained...also i restarted the system, but with no luck...
is it anything to do with memory? i'm confused...dont understand how to handle...
any help will be appreciated...
|
|
|
|
|
Hy,
I had an URL like this "http://172.30.44.21:8080/prm-0-4-0-0/services/IPRM?wsdl", I add this webservice in my WebReferences, and i got all Classes, also the Webmethods that it describes.
When i start the call to the WebMethod "GetListMitarbeiter", --> From .NET, it didn'fill the Object "ObjMitarb". So I try to make a request over browser, and i get an XML response. Which .NET doesn't understand, and cannot parse.
WaWiWS.prmService WaWi=new WaWiWS.prmService();
WaWiWS.ListMitarbeiter objMitarb=WaWi.GetListMitarbeiter();
objMitarb=<not defined=""> in Debug
HOW CAN I Solve this Problem?? Must i write a parser which parse the XML Response?? But this is not the Idea behind wa Webservice. Knows somebody the problems between a Webservice WSDl generated File from AXIS, and the .NET FRAMEWORK.
I can tel the other Company to change the wsdl File, as I want. Can somebody tell me what i must tell them?? Or what they had to change??
I wrote the same Webservice in C#, then i make a request over browser to look at the response XML that .NET understood, and i Send this file to the Guys who developes the webservice generated by AXIS. They change something but it doesn't work at all.
HELP ME!!
|
|
|
|
|
Hi,
if the pc change from a sleep state to an active state,
what system event will the system provide to notify my application
that it is awakened ? Coz my program need to do some stuff
when the pc change from sleep to nonsleep mode.
Thanks
|
|
|
|
|
|
Hi there...
I dont have a "mainform" so i created a notifyicon, contextmenu and the correspondig eventhandler in a normal class which is ran by the Main-function (including a ManualResetEvent - but this isnt important for my problem):
<br />
private NotifyIcon m_notifyIcon = null;<br />
<br />
public ChatNotifier()<br />
{<br />
Initialize();<br />
}<br />
<br />
private void Initialize()<br />
{<br />
<br />
ContextMenu contextMenu = new ContextMenu();<br />
<br />
MenuItem mi1 = new MenuItem();<br />
mi1.Text = "&Optionen...";<br />
mi1.Click += new EventHandler( mnuOptions_OnClick );<br />
mi1.Index = 0;<br />
<br />
contextMenu.MenuItems.Add( mi1 );<br />
<br />
<br />
m_notifyIcon = new NotifyIcon();<br />
<br />
m_notifyIcon.Icon = new Icon( @"c:\test.ico" );<br />
m_notifyIcon.Visible = true;<br />
m_notifyIcon.ContextMenu = contextMenu;<br />
}<br />
<br />
private void mnuOptions_OnClick( object sender, EventArgs eventArgs )<br />
{<br />
new OptionWindow().ShowDialog();<br />
}<br />
What happens:
- The NotifyIcon appears...
- Click on the NotifyIcon and the ContextMenu appears...
- Selecting the MenuItem doesnt do anything...
- Clicking on the NotifyIcon again (NOT the MenuItem) the mnuOptions_OnClick code will be fired and the Form appears...
Whats the beahvoir of this? Why isnt the code fired "immeaditly" when clicking the menuitem?
-----
Thanks for reading
|
|
|
|
|
Hi!
Not having a MainForm could be exactly the reason. I suppose the windows messages are not routed to/from the NotifyIcon to your application correctly without one.
Is there a regular message pump running in your application anywhere?
Regards,
mav
|
|
|
|
|
There isnt any message pump...maybe in the configuration form - but i dont want to keep it in the back
--------------------
Thanks for reading
|
|
|
|
|
Hi all,
I have a problem:
i have a windows user control for example with 1 button and I show it in IE using an html page with
<object classid="http:MyUserControl.dll#MyUserControl.MyUserControl" VIEWASTEXT></object>
and it works fine.
But if MyUserControl contains another Windows user control it stops to work and it does'nt appear
in IE
Any suggestion?
Thanks
|
|
|
|
|
I’m writing ADO program connected to MS access with DataReader. Need to bind a checkedListBox to a table. This is what I wrote:
public void BindCheckedListBox(CheckedListBox BooksCheckedListBox)
{
ArrayList books = new ArrayList();
string sqlBindList = "SELECT BookName " +
"FROM books "+
"ORDER BY BookName ";
OleDbCommand cmdShowStock = new OleDbCommand();
cmdShowStock.Connection = cnShop;
cmdShowStock.CommandType = CommandType.Text;
cmdShowStock.CommandText = sqlBindList;
cnShop.Open();
OleDbDataReader reader = cmdShowStock.ExecuteReader();
BooksCheckedListBox.DataSource = reader;
}
When run it with debbuger I get an exception:
“Complex DataBinding accepts as a data source either an IList or an IListSource”.
Trying to figure out how to work with those interfaces I got nowhere
Please help me clear up this issue!
TIA,
sea#
|
|
|
|
|
Hi,
You can only assign those objects as a datasource which implements ILIst or IListSource interface e.g. DataSet, Array. So you can not assign DataReader as a datasource to a listbox or combobox.
Jayant
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hello all,
I’m trying to develop a simple/personal firewall using C#. I used Jesus O’s class for setting the rules and it is working smoothly. However, I’m trying to search for a way to make the application ask the user if a certain program is trying to access the internet, showing the port, address, direction…etc (just like the popup dialog in ZoneAlarm). I’m not even sure if this is the right place to ask, but any hint on how to do it, implement it, the algorithm for it or the API would be highly appreciated.
Many thanks in advance,
tmp0
|
|
|
|
|
I want to make a programm for checking commentinformation (like summary, param, remarks ans so on) with the real code.
My Problem is who can i read out this information?
In Visual-Studio i can see this in object-explorer an by autointilsence. But who can i get it.
Can anybody help me?
|
|
|
|
|
|
Okay, but who can i do this.
I Want read out the information about class,properties, methods an so on with reflection.
But i see no way to bring together the both information parts.
|
|
|
|