|
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
|
|
|
|
|
well I'm out of touch from desktop applicatoins for quite sometime now
but if u want to show the data of a cell of a dgv in a textbox then u need to use an event , its called onCellClick I think. use its DatagridvieweventArgs object that will give the RowIndex and ColumnIndex Properties to get the data of that particular cell.
I'm sorry I cant give u the code coz I'm bussy in another project at the moment
Hope it helps
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
I tried that one but it doesnt recognise RowIndex and ColumnIndex properties.
|
|
|
|
|
what do u mean it doesnt recognize rowindex and columnindex. show me the code plz
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Heres the code below.
<br />
dataGridView.CurrentCell.Selected = false;<br />
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true;<br />
dataGridView.CurrentCell = dataGridView.SelectedCells[0];<br />
|
|
|
|
|
You can use gridview.CurrentCell.RowIndex or from the event args of the CellClick event e.RowIndex .
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Hello *,
I would like to ask you how I can get last item in ListBox?
Not selected item.
E.g.
In List Box is:
Item 1
.
.
.
Item 13.
How can I get Item 13?
regards
|
|
|
|
|
listbox.Items[listbox.Items.Count-1]
I will use Google before asking dumb questions
|
|
|
|
|
I have a problem with writing algorithm in c#, I don’t know if here is the right place to ask my question, but maybe it indirectly connected to here:
In my program I had to find and display the shortest way from room to room in a building.
I used the djisktra algorithm – an algorithm to find a short way in directed graph.
I had the following problem:
a. many times the user wants to search a room that have been search in the past. I don’t want that each time it will be scanned from the beginning.
Is there a way to save the vertexes that were found in the past? I thought about an idea – to save in a matrix all the vertexes that there was an undirected path between them, with linkedlist to save the way, but it is not always happen to be shortest way – how can I do it anyway?
b. this algorithm is only for directed graphs. In my program most of the cases suits undirected graphs. If there is someone who knows how we doing it usually – I will be happy to get an answer!
For example: room a’ connects to b’, the price between them: 3.
Should I enter to the prices array (source, dest., price) once: a, b, 3 and second b, a, 3 or I can refers it first as source and second as destination?
I will be glad if someone will help me!
thank all!
|
|
|
|
|
ear All,
Good morning to all!!!
I have been developing the Microsoft Visual C# 2.0 Windows application.
Now I have completed my project development. Now I want create a Setup of my projects.
In my project have ‘ONE SOLUTION File’ and have THREE Different type of projects.
1. Solution File
a. Console Application (Project A)
b. Windows Service Project as well as console application (Project B)
c. Window Project (Project C)
I want to create a One Setup files for above solution file. How can I do this?
Kindly any one helps me to implement the Setup of my solution file (Contains 3 Projects).
Please kindly send me the solution for that and send me any related document or links for Setup the projects.
Thank for your time to look on my queries.
Thank you in advance.
Thank you,
Best regards,
Sundar.
B.Sundarapandian
|
|
|
|
|
Just add a new Setup Project to your solution and add the primary output for every project within your solution. When you will build the solution you will have only one setup file with all the output that the 3 projects result.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
hi i m mica 25 female from soeul and i want to import some html files to mysql using c#. i dont know how can complete this job. thanks.
mica
|
|
|
|
|
What you don't know? How to store the file in MySQL or how to connect to it. Be more specific.
I will use Google before asking dumb questions
|
|
|
|
|
thanks for responding me.
well i know how to connect. but dont know how me import html files to mysql using c#. what will be procedure? As i have come to know from google that a command "LOAD DATA INFILE"like that command is used for loading csv files and txt files. "mysqlimport" is another command but me dont know how i can use it.?
please htlp me out?
thanks
mica
|
|
|
|