|
Hi friends,
how can i hide a column from a datagrid.suppose i use a store procedure having eight columns.
i want to hide the primary key column.how can i do that.
remember it is a windows application not web.
thanks
|
|
|
|
|
if u only want to display data.
then u should try using listview control
by using that u can easily hide/show the required columns.
|
|
|
|
|
Hi
Use below code :
<br />
dataGridView1.Columns[0].Visible=false;<br />
I can help you in other fields about DataGridView "freshonline2003@yahoo.com"
Bye
|
|
|
|
|
i am saying about datagrid..not datagridview.
|
|
|
|
|
define a dataset, a datatable, map all the columns of the datatable
while mapping, use mapping type as hidden for the column which you want to hide.
Sr. Software Engineer
Irevna, India
|
|
|
|
|
Test270307 wrote: i use a store procedure having eight columns.
i want to hide the primary key column.how can i do that.
In the stored procedure avoid selecting the column that you don't want to display
|
|
|
|
|
Sorry,I want to make question:
I don't know create Bookmark in code project.where do I can find and create bookmark
where there is a will,there is a way!
|
|
|
|
|
please don't ask the same question twice, respond to my response on the same thread if you want to ask something more.
View/Bookmark brings up the manager, it has a button in the top left to add a bookmark.
this is something you should be able to work out, you won't break anythng by playing with the IDE
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Oh, now I understand. There is no bookmark functionality on the site, I don't think. Your browser will bookmark pages for you.
What does this have to do with C# ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
there is a Bookmark hyperlink on top of each CodeProject article (next to Print,
Broken Article?, etc), but not in the forum messages.
And you get a list of all your bookmarks through the "My Bookmark" hyperlink that
appears near the right top on all CP pages.
|
|
|
|
|
At the top of every article there is "toolbar", where you can bookmark articles. These will show up in "My Bookmarks".
|
|
|
|
|
Hi Everybody,
can u anybody suggest to how to create OLAP database.
Thanks&Regards
RENU
|
|
|
|
|
hello!
first time saw some OLAP/DWH related question! ! it would be better if you could post it in the right forum! anyways can you provide bit more scenario details?
Adeel
--
|
|
|
|
|
Can anyone direct me to someplace that I can learn more about the forms that are built into .NET 2005?
My problem stems from the following: I have three arrays with ten places in them. I can fill both the first two with numbers and retreive them. With Console.Writeline I can show the first two arrays numbers, and the third arrays sumation of the first and second numbers.
Example: Array1{0} = 15 plus Array2{0} = 45, and sums it in Array3{0} = 60.
I can display it in a console application with no problem. I need to display it in a messagebox. I can get the caption and the outputMsg to show in a messagebox.
What I can't get is the set of numbers to show in the messagebox. This brings me back to my request. Can anyone tell me where I can find some more information on the windows forms, especially the message box?
P.S. - Yes this is an asignment for school, and no I'm not asking for somebody to solve it for me. Just to head me in the write direction.
Thank you in advance.
|
|
|
|
|
|
Yes, keshav is right. MessageBox concept is very simple. If you want to learn your self then MSDN site and do some search there. I am ready to take you there if you need.
Sr. Software Engineer
Irevna, India
|
|
|
|
|
what is the Bookmark?
where there is a will,there is a way!
|
|
|
|
|
It's how you mark your page, like in a book.
Do you mean bookmarks in VS ? Same concept, a way to mark your place.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how can i access control that is on parent mdi form from the child mdi form.
|
|
|
|
|
Use the Parent property of child MDI form. Then you can access controls collection to find your desired controls.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
make that control public. create an object of that form. access that control through this object in your child form
Sr. Software Engineer
Irevna, India
|
|
|
|
|
Hello,
I have developed a windows control which has a toolbox. At this time, I made the system like this : The user of my Windows control can edit an XML file to customize the toolbar for image, text and click event. Now, it is a very boring and inefficient method. Is it really possible that the toolbar I am providing, my user could directly edit the toolbar item collection from Visual Studio Properties Editor and also directly create Click Event Handlers of their custmized toolbar items. ? In a word, in my custom control, I want the toolbar should behave as a Visual Studio editable Toolbar in Design Mode when I ship the control to my client/user.
I would appreciate your response. Please show me some resource URL where I can learn about it more.
Regards
emran
|
|
|
|
|
hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1
namespace Proj
{
public partial class frmMain : Form
{
private string[] tx_data = new string[14];
private string[] rx_data = new string[10];
public int i;
public frmMain()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label16_Click(object sender, EventArgs e)
{
}
private void label18_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void txtTxmID1_TextChanged(object sender, EventArgs e)
{
}
private void txtTxmID5_TextChanged(object sender, EventArgs e)
{
}
private void lblRx2_TextChanged(object sender, EventArgs e)
{
}
private void lblRx5_TextChanged(object sender, EventArgs e)
{
}
private void cmdRead_Click(object sender, EventArgs e)
{
readID;
//For i = 1 To 6
// lblRx(i).Caption = rx_data(i + 1)
//Next i
string OutString = null;
string Instring = null;
int y = 0;
open_port;
//If the port is opened...
if (Comm1.PortOpen)
{
//tx_data(0) = "R"
//tx_data(1) = "I"
//tx_data(2) = "D"
//For i = 0 To 2
// Comm1.Output = tx_data(i)
//Next i
OutString = "RID";
Comm1.Output = OutString;
}
}
private void Comm1_OnComm()
{
string Instring = null;
for (i = 0; i <= 7; i++)
{
Instring = Comm1.Input;
if (Instring == "")
{
rx_data[i] = "00";
}
else
{
rx_data[i] = System.Convert.ToString(System.Convert.ToInt32(Instring[0]), 16).ToUpper();
}
}
Comm1.PortOpen = false;
for (i = 0; i <= 7; i++)
{
if (rx_data[i].Length < 2)
{
rx_data[i] = "0" + rx_data[i];
}
}
for (i = 1; i <= 6; i++)
{
lblRx[i].Caption = rx_data[i + 1];
}
}
public void open_port()
{
// Use COM1.
if (frmMain.Comm1.PortOpen == false)
{
frmMain.Comm1.CommPort = 1;
// 4800 baud, no parity, 8 data, and 1 stop bit.
frmMain.Comm1.Settings = "4800,N,8,1";
frmMain.Comm1.PortOpen = true;
}
}
public void Display_SysID()
{
open_port;
//If the port is opened...
if (frmMain.Comm1.PortOpen)
{
//tx_data(0) = "R"
//tx_data(1) = "M"
//tx_data(2) = "g"
//tx_data(3) = Chr(5)
//tx_data(4) = Chr(7)
//For i = 5 To 11
//tx_data(i) = 0
//Next i
//For i = 5 To 11
//tx_data(11) = tx_data(11) Xor tx_data(i)
//tx_data(i) = Chr(tx_data(i))
//Next i
//For i = 0 To 11
// frmMain.Comm1.Output = tx_data(i)
//Next i
frmMain.Comm1.Output = "R" + "M" + "g" + (char)(5) + (char)(7) + '\0' + '\0' + '\0' + '\0' + '\0' + '\0' + '\0';
frmMain.Comm1.PortOpen = false;
}
}
private void Form_Unload(int Cancel)
{
System.Environment.Exit(1);
}
public void writeID(string SysID, string SchID, string DeptID, string BlkID, string LevelID, string ClkID)
{
string OutString = null;
OutString = "";
tx_data[0] = "R";
tx_data[1] = "P";
tx_data[2] = "g";
tx_data[3] =
tx_data[4] =
tx_data[5] =
tx_data[6] =
tx_data[7] =
tx_data[8] =
for (i = 0; i <= 12; i++)
{
OutString = OutString + tx_data[i];
}
open_port;
//If the port is opened...
if (Comm1.PortOpen)
{
Comm1.Output = OutString;
Comm1.PortOpen = false;
}
}
public object cvtHexDec(string txtID)
{
string firstnum = null;
string secnum = null;
int f = 0;
int s = 0;
if (txtID.Length == 2)
{
firstnum = txtID.Substring(0, 1).ToUpper();
secnum = txtID.Substring(1, 1).ToUpper();
}
else
{
firstnum = "0";
secnum = txtID.Substring(0, 1).ToUpper();
}
for (i = 65; i <= 70; i++) // check for A - F (Hex format)
{
if (f == (char)(i))
{
f = (i - 55) * 16;
break;
}
}
for (i = 48; i <= 57; i++) // check for 0 - 9 (Hex format)
{
if (f == (char)(i))
{
f = (i - 48) * 16;
break;
}
}
for (i = 65; i <= 70; i++) // check for A - F (Hex format)
{
if (s == (char)(i))
{
s = i - 55;
break;
}
}
for (i = 48; i <= 57; i++) // check for 0 - 9 (Hex format)
{
if (s == (char)(i))
{
s = i - 48;
break;
}
}
f = f + s; //add the total of fisrtnum & secnum dec
cvtHexDec = (char)(f); //convert back to char
}
public object cvtHexToDec(string txtID)
{
string firstnum = null;
string secnum = null;
byte f = 0;
byte s = 0;
if (txtID.Length == 2)
{
firstnum = txtID.Substring(0, 1).ToUpper();
secnum = txtID.Substring(1, 1).ToUpper();
}
else
{
f = Convert.ToByte(0);
s = Convert.ToByte(0);
}
if (System.Convert.ToInt32(firstnum[0]) >= 65)
{
f = System.Convert.ToInt32(firstnum[0]) - 55;
}
else
{
f = System.Convert.ToInt32(firstnum[0]) - 48;
}
f = f * 16;
if (System.Convert.ToInt32(secnum[0]) >= 65)
{
s = System.Convert.ToInt32(secnum[0]) - 55;
}
else
{
s = System.Convert.ToInt32(secnum[0]) - 48;
}
f = f + s; //add the total of fisrtnum & secnum dec
return (char)(f); //convert back to char
}
private void cmdWrite_Click(object sender, EventArgs e)
{
writeID(txtTxmID0.Text.ToUpper(), txtTxmID1.Text.ToUpper(), txtTxmID2.Text.ToUpper(), txtTxmID3.Text.ToUpper(), txtTxmID4.Text.ToUpper(), txtTxmID5.Text.ToUpper());
}
}
}
|
|
|
|
|
You have to define Comm1. Right now your not telling the Project what or where Comm1 is
|
|
|
|
|
can u show where am i to define it?? thanks
|
|
|
|