|
Yes, I'll named control like txtUsername, and named variable userName.
But now, I have to named control like userNameTextBox... but I don't like...
Glad to discuss with you and best wishes.
|
|
|
|
|
The actual class: MyTextBox
The class instance: myTextBox
Its properties and events: Text ... TextChanged
Why, to follow the convention that is used almost everywhere, and so I can see instantly if I'm working with an instance or a static
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I use buttonOK , checkboxCheckMe , etc. That way, all controls of the same type are grouped in the same place in intellisense.
You could take it a step further and maybe use ctlButtonOK , and ctlCheckboxCheckMe , and that would put *all* of the controls in one single group in intellisense, yet still separate the controls by type within the group.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: all controls of the same type are grouped in the same place in intellisense.
Agree with you, especially for the same type control.
Glad to discuss with you and best wishes.
|
|
|
|
|
I want to get a device state(enable or disable)?
If i have a device name, how to get it?
Thank a lot.
|
|
|
|
|
What kind of device are you working with?
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Try using WMI to get the device.
Glad to discuss with you and best wishes.
|
|
|
|
|
getting the row index in c#
|
|
|
|
|
rowindex in which control
cheers,
sneha
|
|
|
|
|
Hi everybody,
I am unable to get the index of the row which is selected by the user through checking a checkbox.
After getting the index I want to delete the row directly from the datagrid on that particular index.
There is no interaction with the datagrid..
Please help me out.Its urgent...
cheers,
sneha
|
|
|
|
|
Well, seeing as it's urgent!
How about using the CurrentRow property of the DataGrid?
|
|
|
|
|
You mean to say the "currentrowindex" property.But it's not working.
Give me some idea.
I am using this code to update the row according to the user's input.
protected void BtnUpdate_Click(object sender, EventArgs e)
{
dt = (DataTable)Session["Cart"];
CheckBox chkSelected = new CheckBox();
foreach (DataGridItem dgItem in DataGrid2.Items)
{
chkSelected = (CheckBox)dgItem.FindControl("chkSelection");
if (chkSelected.Checked == true)
{
TextBox TxtQTY = (TextBox)dgItem.Cells[2].FindControl("TxtQTY");
int Txt2 = Convert.ToInt32(TxtQTY.Text);
Label lblProduct_Id = (Label)dgItem.Cells[0].FindControl("lblProduct_Id");
string id2 = lblProduct_Id.Text;
Label lblDescription = (Label)dgItem.Cells[1].FindControl("lblDescription");
string desc2 = lblDescription.Text;
Label lblPrice = (Label)dgItem.Cells[3].FindControl("lblPrice");
float price2 = Convert.ToSingle(lblPrice.Text);
Label lblCost = (Label)dgItem.Cells[3].FindControl("lblCost");
float cost2 = Convert.ToSingle(lblCost.Text);
float final_cost = price2 * Txt2;
DataRow myrow = dt.NewRow();
myrow["REF"] = id2;
myrow["Description"] = desc2;
myrow["QTY"] = Txt2;
myrow["Price"] = price2;
myrow["Cost"] = final_cost;
dt.Rows.Add(myrow);
dt.AcceptChanges();
Session["data"] = dt;
}
}
DataGrid2.DataSource = dt;
DataGrid2.DataBind();
}
cheers,
sneha
|
|
|
|
|
You can get the index of the checked row DataGridViewCellEventArgs in the CellContentClicked event.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi,
I am using datagrid not the datagridview.Please give me an idea for datagrid.Believe me I tried a lot but I am unable to do this.
cheers,
sneha
|
|
|
|
|
hi,
instead of using foreach, use for(int rowindex=0;rowindex<dtg.items.count;rowindex++)>
.thus 'rowindex' will giv the rowindex...try this....
|
|
|
|
|
|
Nikki05 wrote: Am just in my highschool.
So ask your teacher, thats what they get paid for. The idea of CP is to help people with specific problems, not do their (home)work for them. If someone gave you the code what would you learn? How to Copy and Paste?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Pls help me in implementing kerberos authentication in web application using C#...
|
|
|
|
|
Repost[^]
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
I have an applications which uses many stored procedures and is to be deployed on laptops. It uses SQL server express. When users shut their machine the stored procedures will vanish. Now I have two ideas of how to tackle this:
1. Create all the stored procedures every time the application starts or
2. Create all the stored procedures at the windows start up (ideal)
Which option do you recommend? How can I do option 2--if better?
How would you tackle such a situation?
Visual Basic is for basic people, C# is for sharp people.
|
|
|
|
|
What do you mean the stored procedures vanish?
|
|
|
|
|
3. Fix the problem.
I've had stored procedures disappear, but not consistently.
Perhaps you don't commit the stored procedure creation?
4. Don't use stored procedures; they're so last century.
|
|
|
|
|
PIEBALDconsult wrote: 4. Don't use stored procedures; they're so last century.
What? Use embedded sql in your apps so they have to be deployed to all users for simple changes? Not really abstracting your data access is it?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
PIEBALDconsult wrote: 4. Don't use stored procedures; they're so last century
I don't know where you get that idea from?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hello guys!
I have a little problem with my first C# program.
I'm making a room cam controller with my webcam. What it does is, time to time, it connects to the cam and take a pic. No big deal.
My problem is, when the cam is in use (in MSN for example), the instruction that connects to the cam
SendMessage(mCapHwnd, WM_CAP_CONNECT, 0, 0)
opens a Dialog asking me to select the device to use (in my case i only have one webcam)
How can i bypass this? I mean, if it cannot connect it just don't take any pic, it wouldn't be any problem. The problem is that it starts to fill the screen with Dialog Boxes, so what i really want is avoid the Dialogs.
Please help
|
|
|
|