|
So the SelectIndexChanged event would fire when the user selects an item? How would I do that?
Lucy
|
|
|
|
|
Lucy_H85 wrote: checked listview
Haven't heard of it. Is it a ListView with CheckBoxes or CheckedListBox?
I will use Google before asking dumb questions
|
|
|
|
|
It is a listview with checkboxes.
Lucy
|
|
|
|
|
Well....I will just give you an idea. The StackOverflow exception is because in the CheckChanged event you change the checked property of the listview items, thus this generating another checkchanged event, and so you enter in a infinite loop, which at a certain moment fills the system's stack and the program stops. To avoid this situation you should check if the checkedchanged event has been triggered by the user or by your code. I situation almost like these I used to use a boolean value which is set to true if I change the checked property of an item, or false if the user checks the item, and in the event handler method do whatever you need depending on the value. It's just an idea to work around this problem...maybe you'll find another one.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Thank you for your help. Yes I noticed that both of these events were fired many times whilst debugging. I now understand a bit more about stacks. I will try and use boolean values to solve my problem.
Lucy
|
|
|
|
|
I manage to play video in panel in c#. Now i want to play another video automically when the panel is idle(like screensaver). How can i determine that the panel is idle?and then i want to play another video. Please help me with this problem
|
|
|
|
|
You might want to play the other video when the previously running video is no longer running. I'm sure there must be something that determines if the stream is at an end.
What are you using? WMP?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
No i am not using windows media player. It is directly running on panel.Do u know anything that determine video is stop.
|
|
|
|
|
Post some code. Particularly the code that you have that declares your player and the code that you use to play the clip.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
Hi. I have a DataTable with a column with Value 0. I want to search the Column and replace the 0 with a 1. Can anybody help me with this? Below is what I have so far.
private void tlstrbtnExpUpd_Click(object sender, EventArgs e)
{
DataTable dt = m_dtCallCentre;
foreach (DataRow dr in dt.Rows)
{
if (dr["Exported"].ToString() == "0")
{
}
}
}
Much appreciated.
|
|
|
|
|
private void tlstrbtnExpUpd_Click(object sender, EventArgs e)
{
DataTable dt = m_dtCallCentre;
foreach (DataRow dr in dt.Rows)
{
if (dr["Exported"].ToString() == "0")
{
dr["Exported"] = "1";
}
}
dt.AcceptChanges();
}
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Hi Mate. I tried this and it doesn't work.
|
|
|
|
|
After you modified the contents of the DataRow you should also call dr.AcceptChanges(). I tried it just now and it works fine.
I will use Google before asking dumb questions
|
|
|
|
|
Sorry about this mate. But should it look like this?
private void tlstrbtnExpUpd_Click(object sender, EventArgs e)
{
DataTable dt = m_dtCallCentre;
int iColCount = dt.Columns.Count;
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (dr["Exported"].ToString() == "0")
{
dr["Exported"] = "1";
}
}
dr.AcceptChanges();
dt.AcceptChanges();
}
}
|
|
|
|
|
How many rows do you have? It may be inefficient to iterate through the rows one at a time.
|
|
|
|
|
Hi. I currently have approx 69 rows. It seems to be reading each row but it is not doing the update. Any other idea?
|
|
|
|
|
private void tlstrbtnExpUpd_Click(object sender, EventArgs e)<br />
{<br />
DataTable dt = m_dtCallCentre;<br />
foreach (DataRow dr in dt.Rows.Select("Exported=0"))<br />
{<br />
dr["Exported"] = "1"; <br />
}<br />
dt.AcceptChanges();<br />
}
|
|
|
|
|
HI mate. System.Data.DataRowCollection does not contain a definition for 'Select'.
|
|
|
|
|
My bad - typo. It's dt.select, not dt.rows.select.
|
|
|
|
|
Thnks mate but for some reason this doesn't work either. I'm at a complete loss now.
|
|
|
|
|
Is there a way to prevent a DataGridView with TextBox fields from skipping to next row after pressing Enter after editing value in Cell? In cell Edit mode it automatically goes to next row after pressing Enter. I've tried overriding OnKeyDown, OnCellEndEdit, OnCellLeave, EditingControlShowing and adding handler to TextBox control, but there seems to be an event occuring after all those events and I can't find where to catch the event where DataGridView finished editing cell and skips to next row. Any Ideas?
Tnx in advance
Dragan Matic
|
|
|
|
|
Dragan Matic wrote: there seems to be an event occuring after all those events and I can't find where to catch the event
You can always use Spy++ to see what events occur, and their order.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Count you not just set the AllowUsertoAddRows property of the datagrid to false?
|
|
|
|
|
No, because I have a problem with editing the cells. After I enter some text in the cell, and after pressing Enter and if there is another row under the current one, the cell under the edited one becomes selected. Setting AllowUserstoAddRows to false will not change that behavior. And if I add event handler to say, CellEndEdit and move it somewhere else (say, to the next cell in the same row), some other event moves the active cell to the next column after that, so I get active cell moved one place right and one place down. I cannot find where that event is occurring.
|
|
|
|
|
Hi all
Im using C# 2005, I have a button search which when you click refreshes the datagridview and displays the search results that's fine. Now what I want is when I select a row or cell the data in that row appear on the respective textboxes in the form to allow the user to update if they want, is there a way that I can do this or another way maybe. Any help will be appreciated!!
<br />
private void btnSearch_Click(object sender, EventArgs e)<br />
{<br />
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";<br />
string Company = txtSearch.Text ;<br />
string select = "SELECT * FROM ecmain WHERE CompanyName Like '" + Company + "'";<br />
OleDbConnection datatryConn = new OleDbConnection(strConnection);<br />
datatryConn.Open();<br />
OleDbDataAdapter da = new OleDbDataAdapter(select, datatryConn);<br />
DataSet ds = new DataSet();<br />
<br />
da.Fill(ds, "ecmain");<br />
<br />
dataGridView.AutoGenerateColumns = true;<br />
dataGridView.DataSource = ds;<br />
dataGridView.DataMember = "ecmain";<br />
<br />
<br />
datatryConn.Close();<br />
Thanx in advance
Csanda
|
|
|
|