|
1. When you click a row on the far left, it highlights the entire row.
is there a way to do this with a DataGrid method?
2. I would also like to tab down rows instead of across cells. I see where you can capture the tab change, but i don't know how to focus on a row ( relating to my first question )
any insight would be much appreciated. c# is great!
|
|
|
|
|
this.dataGrid1.Select(this.dataGrid1.CurrentRowIndex);
i thought i knew how to capture the tab change, but it doesn't work as expected.
is there a way to capture tab within the data grid? then i can use the code above to focus on the next row down.
|
|
|
|
|
sink the keydown event then use your above code
protected override bool ProcessKeyPreview( ref System.Windows.Forms.Message m)
{
Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode;
if((m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP) && keyCode == Keys.Tab)
{
dg1.Select(dg1.CurrentRowIndex++);
MessageBox.Show("Hey");
return true;
}
else
return true;
}
theres the code to override the key event but the problem is for checkbox columns it will work.
But for other columns YOU MUST extend the DataGridTextBoxColumn class and provide your own event handling inside.
CHeck this link:
Dude the everything I ever wanted to know about DatraGrids
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
the first should return false sorry.
But I would inherit the grid and extend the OnCurrentCellChange method ( I think thats the name, but its real close.) in that create a delegate and raise an event cell change or inside force a new row instead of a new column.
thats would be easier or create your own extended columns thier both fast an easy.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I want to return my defined class from my XML Services. In the test page there is no probem and it display page correctly,but in my windows appplication there is problem. When in my windows application I want to return my class from my xmlservice function I got compiler error:
Can not imlpictly convert from localhost.webservicenamespace.myclassname to Myclassnamespace.myclassname
So I change it to localhost.webservicenamespace.myclassname but now here I get null object. Should I do anything special for getting custom types from XML web services? Any idea?
Mazy
No sig. available now.
|
|
|
|
|
|
Hi Nish:
The problem was that I have to connect to internet when I want to use my web service,but it works on ASP.NET without connecting to internet.
I want to post this last night but it might it was a problemm with CP database.Any way,thanks.
Mazy
No sig. available now.
|
|
|
|
|
has anyone programmed a bot for MSN using c#?
im trying to make one myself. so i need to check out some samples.
im also new to c# programming but i'll get along well.
i found dotMSN library. but the sample that came along didnt compile. so i need to see some others before i get going on my own.
can anyone help ?
|
|
|
|
|
I have a method (name=HelloCSharp.Rand(), see below "QUESTION HERE") that's uses "uint" as parameter and return type - therefore not CLS-complaint and I was expecting a compiler error. Problem is, there was NOT a compiler error (or error of any kind)... THanks.
namespace SomenameSpace
{
using System;
public class NukeIt
{
public NukeIt(){ }
//NO PROBLEM HERE: This method NOT CLS-compliant and generated a compiler warning as expected.
public uint Rand(uint nSeed) {return nSeed;}
}
class HelloCSharp : HelloVB
{
public HelloCSharp()
{
}
public override void Hello()
{
base.Hello();
Console.WriteLine("Hello, C#");
}
public new int Add(int val1, int val2)
{
return val1+val2;
}
//QUESTION HERE: "uint" is NOT CLS-compliant and should generate a compiler warning, but, it did NOT??
public uint Rand(uint nSeed)
{
return nSeed;
}
[STAThread]
static void Main(string[] args)
{
HelloCSharp hello = new HelloCSharp();
hello.Hello();
}
}
}
Thanks!
norm
|
|
|
|
|
|
|
if your code is cls compliant, it means that ANY .NET language can run your code, but if it is not CLS complint, i.e. uses features only available in C#, then only C# applications can run your code.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
I can populate a dataset and create a datagrid, but now it is time to do something with it.
I have a datagrid which shows a list of contacts. I want to be able to click on a row and have it execute a method. ( open a new form to edit the contact )
Are there any tutorials, or quick times one could advise?
Thanks!
|
|
|
|
|
|
Thank You, that is a great reference.
This question is related. I can get the CurrentRowIndex, but I would like to get a value of one of the cells instead.
<br />
txtCustomerID.Text=this.dataGrid1.CurrentRowIndex.ToString;<br />
I would like the text box "txtCustomerId.Text" to reflect colume "CustomerID" in dataGrid1
|
|
|
|
|
i think my problem was that i need to refer to the data set instead of the data grid.
i just declared my data set globally so i could access it anywhere.
<br />
txtCustomerID.Text=ds.Tables["Contacts"].Rows[this.dataGrid1.CurrentRowIndex][0].ToString();<br />
|
|
|
|
|
Hello,
Does anyone know of a method to keep the .NET Framework updated automatically/programatically similar to how Windows updater works?
I know that dotfx.exe can be downloaded and ran, but this cotains a large amount of files. If there anything at there that can detect just which files have changed and allow my program to install just those files?
Does C# have any built in functions to perform checks and updates on the framework?
Thanks
|
|
|
|
|
Dang! How much I wish Microsoft included an automatic update feature. Too bad there is nothing built in.
However, it wouldn't be that hard to check for newer versions on the local computer (just use the Reflection classes). I'm just not sure how to check for newer version on the internet. Maybe there is an RSS feed for MS product versions? Try looking for some resource like that
|
|
|
|
|
I found this article (http://windowsforms.net/articles/appupdater.aspx) on a .NET Updater Component that is also used in the .NET Terrarium game. This is one solution to keeping your app up to date, but doesnt look to be able to detect and keep the *.NET Framework* itself up to date.
|
|
|
|
|
I haven't looked at it yet. But, wow, that a neat feature. I looked at the older version earlier, and it didn't have that feature.
|
|
|
|
|
The dotnetfx bootstrapper (dotnetfx.msi) exactly fits your need, since only the .msi file is downloaded and run (small file), and then the rest is downloaded if required. There are articles on MSDN.
As a sidenote, dotnetfx[^] command-linez
RSS feed
|
|
|
|
|
The dotnetfx is a Redistributable, it is all of the framework. Not a small file.
And it does not update portions of the framework. Windows Update already updates
framework installs with patches and service packs and also has new versions of the
framework. A boot strapper performs checks at install time and if the framework
is not installed then it installs it. At least that is my understanding of it.
Bo Hunter
|
|
|
|
|
I think you should re-read my post.
I have made a clear distinction between dotnetfx.exe (the full redistribuable, >20 MB) and dotnetfx.msi (the bootstrapper, which is a small file).
May be dotnetfx.msi is not the exact name of the bootstrapper (I saw this a year ago, so I don't remember the actual name) but you get the idea.
RSS feed
|
|
|
|
|
Can you post a link to the dotnetfx.msi?
Bo Hunter
|
|
|
|
|
It's a merge module, whose name is dotNETFXRedist_x86.msm, which you can find in your install folder <installdir> \ Common7 \ Tools \ Deployment, as well as on the VS.NET CD1.
The trick is actually based on how you populate the setup (your .msi file) with merge modules.
Depending on it, you can check at install-time a module against a given version BEFORE the appropriate merge module gets downloaded or not from the net or any other location.
RSS feed
|
|
|
|