|
Jamie1985 wrote: alert('You are prompted to type this twice for a reason!');
remove the line with the popup?
|
|
|
|
|
I guess you got that code from somewhere else huh? Otherwise you'd know exactly what to do.
But yeah, just remove the alert.
Also, when last i checked, c# didn't have, alert or var.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Yeah that looks like JavaScript to me
|
|
|
|
|
hi
all, any body
pls help me to solve my problem. Though my code is right (i feel) i couldnt achieve the result i expect , i tried in all means, any one pls solve my headache!.
private void DataGrdVw1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)<br />
{<br />
string CurrentSelValue;<br />
CurrentSelValue = DataGrdVw1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();<br />
txtAreaName.Text = CurrentSelValue;<br />
}
it doent works!.
i tried with cell mouse down event also no use.
private void DataGrdVw1_CellMouseDown(object sender,DataGridViewCellMouseEventArgs e)<br />
{<br />
<br />
<br />
this.GrdText.Text = DataGrdVw1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();<br />
}<br />
i need to show the current cell s text in a text box when the datagridview's cell is clicked with mouse, or arrow keys
pls help
kssk
KSSK
|
|
|
|
|
Use the DataGridView's CellEnter event, and then use the CurrentCell property:
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
label4.Text = dataGridView1.CurrentCell.Value != null ? dataGridView1.CurrentCell.Value.ToString() : String.Empty;
}
Notice that I'm also checking here if the cell value is null, and setting the textbox text to String.Empty if it is, otherwise you get a nasty Null Reference Exception when trying to call ToString() a non-existent value.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Hi,
I've seen some programs use wide images which have like 3 images inside and on run-time only a third on the image is shown in a picture-box and on mouse-over a different third of the image is shown and on-click a different third of the image is shown. does anyone know how to do that or there any built class for such things?
Thanks
|
|
|
|
|
Hi,
there is about 100 ways how you can do that . However there is no class that would support that in .NET namespace directly. You have to write your own or maybe use somebody's else custom class. Override the OnPaint method of control class and render the part of Image you need according to mouse state (whatever condition).
hope that helps
zilo
|
|
|
|
|
is there a way that you can manually sort gridview columns
basically i want the columns to display in alphabetical order but only one column seems to display a-z at a time
i want a user to be able to click on sort a-z one column then sort a-z in another so both columns and together sorted a-z
hope this makes sense !
|
|
|
|
|
Jamie - yes multiple-column sorting is possible, but requires a little bit of work on your part. Here's an article to get you started: http://windowsclient.net/blogs/faqs/archive/2006/07/10/how-do-i-sort-on-multiple-columns.aspx[^]
If you're using .Net 3.5 you could also use LINQ.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
hi
i am having two forms
form1 is having two functions and a bool variable
code is ::::
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public bool s = true;
Form2 f2 = new Form2();
private void Form1_Load(object sender, EventArgs e)
{
f2.MdiParent = this;
f2.Show();
}
public void a()
{
MessageBox.Show("u r in a ");
}
public void b()
{
MessageBox.Show("u r in b ");
}
}
the code for form 2 is
:::::::
public partial class Form2 : Form
{
Form1 ff;
public Form2()
{
InitializeComponent();
ff = (Form1)this.MdiParent;
}
private void button1_Click(object sender, EventArgs e)
{
ff.a();
ff.b();
if (ff.s == true)
{
MessageBox.Show("yes");
}
}
}
error is coming at ff.a().. ff.b()...ff.s as object reference not set to an instance of the object ....
plz tell me the problem
n..solution too
regards
sindhu tiwari
its me sid
|
|
|
|
|
sindhutiwari wrote: error is coming at ff.a().. ff.b()...ff.s as object reference not set to an instance of the object ....
plz tell me the problem
The problem is as the exception said. In other words, ff is null .
sindhutiwari wrote: n..solution too
Think about the sequence that your statements are actually called in. You assign ff to be the MdiParent BEFORE you tell the form what its MdiParent is. Therefore ff is null because MdiParent is null at the time that ff is assigned.
The solution is to assign ff AFTER MdiParent is assigned. OR Don't use ff at all but to reference the MdiParent directly when it is needed.
You might also want to give things a sensible name. Form1, Form2, ff, a(), b() and so on are very poor names. They mean nothing to anybody.
|
|
|
|
|
Hi,
I'm newly using FileIOPermission class, Can any one explain me how to use this class in .Net 1.0 using C#, to set or get permissions for the file?
Thanks in Advance,
SMARTech
************************************************
If you think you can, You Can...
************************************************
|
|
|
|
|
shah_tech wrote: Can any one explain me how to use this class in .Net 1.0 using C#, to set or get permissions for the file?
Have you read the documentation[^]? It seems to have a fairly comprehensive example.
|
|
|
|
|
I have built a windows service with c#.net.And to start that service i built a icon to start and stop that service with windows application.Now,I want to build a setup for that project and both the project needs to be installed with that setup file.How should I do this?please suggest me.
Thank u.
|
|
|
|
|
You add the project output of both the service and windows application to the installer. All three projects will, naturally, sit in one solution.
|
|
|
|
|
I'm trying to develop an application for a player's statistics per game. Here's the XML:
<GameStat>
<PlayerID>21</PlayerID>
<TeamID>8</TeamID>
<GameID>
<int>1</int>
<int>2</int>
<int>3</int>
<int>4</int>
</GameID>
<Score>
<int>18</int>
<int>25</int>
<int>15</int>
<int>31</int>
</Score>
</GameStat>
These data will be stored in an SQL Server Database. I have two tables, namely tblGame & tblGameInfo. When inserted in the database, the data will look like this: (pls don't mind the --)
tblGame
------------------------------------------
GameStatID----------PlayerID----------TeamID
1------------------------21----------------8
------------------------------------------
tblGameInfo
------------------------------------------
GameID----------Score
1--------------------18
2--------------------25
3--------------------15
4--------------------31
------------------------------------------
Can anybody please help me with this? Thanks
Just a C# newbie
|
|
|
|
|
I think googling for SqlDataAdaptor, DataSet and DataTable will get you on your merry way
DataSet is basicly an in-memory kind-of database and DataTable are your tables. You can load your xml file in those.
If that's done, you can do whatever you want with it.
You can use it as a datasource, port it (trough the SqlDataAdaptor) to your database etc...
Hope that helps
|
|
|
|
|
hi,
Assume that they are three forms form1 . form2 . form3
now
1. form1 is a mdi form
2. i am making a object of form2 in form1 then made form1 as . mdiparent of form2 then showing it.. till now its fine
3. i have made object of form3 in form2.which i am showing from form2
here i want to make form3 as a mdi child of form 1 how to do this
please do reply
regards
sindhu tiwari
its me sid
|
|
|
|
|
I assume your are creating form3 in form2 as follow
<br />
<br />
form3 frm = new form3();<br />
<br />
then add
<br />
<br />
frm.mdiparent = this.mdiparent;<br />
<br />
Simple isn't it ?
|
|
|
|
|
Does any1 know if its possible to disable gridview so no1 can click on it and copy the text, i.e. its totally disabled
cheers
|
|
|
|
|
Hi,
Just set the gridview's Enabled property to "False", i.e.
<br />
GridView.Enabled=False<br />
Regards,
Ujjaval Modi
Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
|
|
|
|
|
this doesnt stop someone right clicking on the text and copying it, this is what i need for them not to be able to right click and copy the text
any ideas?
|
|
|
|
|
<asp:gridview visible="false">
Im afraid thats about your only choice. Im afraid that putting something on the internet makes it highlightable, right-click-able, view-sourceable or printable. There is no sure fire way of stopping any of these methods of copying the page short of making it invisible or not putting it on the internet to start with.
modified on Friday, December 21, 2007 5:53:36 AM
|
|
|
|
|
ah i thought i had seen it somewhere before where you couldn't copy text
never mind
thanks anyway
|
|
|
|
|
You can do it with some javascript, BUT that will work only against totally non-tech users. Anyone who know how to disable javascript or view page source in browser will be able to steal whatever you send to client.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|