Click here to Skip to main content
15,894,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: Refreshing DataSet Pin
imsathy29-Jan-06 20:12
imsathy29-Jan-06 20:12 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 5:58
emran83430-Jan-06 5:58 
AnswerRe: Refreshing DataSet Pin
Drew McGhie30-Jan-06 3:38
Drew McGhie30-Jan-06 3:38 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 6:14
emran83430-Jan-06 6:14 
GeneralRe: Refreshing DataSet Pin
Drew McGhie30-Jan-06 10:15
Drew McGhie30-Jan-06 10:15 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 11:52
emran83430-Jan-06 11:52 
GeneralRe: Refreshing DataSet Pin
imsathy30-Jan-06 18:27
imsathy30-Jan-06 18:27 
GeneralRe: Successful but had to modify little. Pin
emran83431-Jan-06 17:04
emran83431-Jan-06 17:04 
Hi Sathy,
How are you ! Thanks a loooooooooooot for the nice Help.
Ok, The way you have shown me was excellent. I could add new rows and I could see the new added row in datagrid view, but i had a problem that, the binding source was not being updated with that way, so Other DataBounded Controls lost track of that DataGridView. So, When I modified the line
myDataGridView.DataSource = resumeDataSet.Tables["job_Boards"].DefaultView;
to the following line,

jobBoardsBindingSource.DataSource = resumeDataSet.Tables["job_Boards"].DefaultView;

Then, All controld who are bounded with same databinding source started working properly.

After that, I found that, this is only working when I ADD or UPDATE rows, but when I delete, DataBindingSource is not being effected and thus DataGridView is not removing that row. After fighting with this problem for hours, I found some alternative working way.

I used the following snippet to remove the selected Row after deleting the row with a Manual SQL Query.

if (dataGridViewJobBoards.SelectedRows.Count > 0 && this.dataGridViewJobBoards.SelectedRows[0].Index != this.dataGridViewJobBoards.Rows.Count - 1)
dataGridViewJobBoards.Rows.RemoveAt(dataGridViewJobBoards.SelectedRows[0].Index);


And in this way, All problem has been solved. As DataGridView is bounded to a commonDataBindingSource which is being shared by other controls, so, removing that row had an effect of all connected controls to update their rows.

Thanks a looooooooooot. The bottom line is , My problem has been solved. I am happy.

I appreciate your co-operation.

Emran


public void refreshJobBoardBindingSource()
{
SqlDataAdapter myJobBoardAdapter = new SqlDataAdapter("SELECT job_Boards.* FROM job_Boards", sqlConnectionMain);
myJobBoardAdapter.Fill(resumeDataSet.Tables["job_Boards"]);
jobBoardsBindingSource.DataSource = resumeDataSet.Tables["job_Boards"].DefaultView;
}
Questionsql server license Pin
fmardani29-Jan-06 12:54
fmardani29-Jan-06 12:54 
AnswerRe: sql server license Pin
bootn29-Jan-06 17:21
bootn29-Jan-06 17:21 
AnswerRe: sql server license Pin
Dario Solera29-Jan-06 22:22
Dario Solera29-Jan-06 22:22 
QuestionAudio Problem Pin
snouto29-Jan-06 12:44
snouto29-Jan-06 12:44 
QuestionWindows Media Player Remote Control Pin
pittuck29-Jan-06 12:32
pittuck29-Jan-06 12:32 
QuestionMigration from .NET 1.1 to 2.0 Pin
MrEyes29-Jan-06 11:28
MrEyes29-Jan-06 11:28 
AnswerRe: Migration from .NET 1.1 to 2.0 Pin
User 665829-Jan-06 11:39
User 665829-Jan-06 11:39 
AnswerRe: Migration from .NET 1.1 to 2.0 Pin
leppie29-Jan-06 17:56
leppie29-Jan-06 17:56 
QuestionDatabase search Pin
BH Serpa29-Jan-06 10:36
BH Serpa29-Jan-06 10:36 
QuestionWPF in VSTS ? Pin
Christian Graus29-Jan-06 9:53
protectorChristian Graus29-Jan-06 9:53 
AnswerRe: WPF in VSTS ? Pin
User 665829-Jan-06 10:14
User 665829-Jan-06 10:14 
AnswerRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 10:18
Joshua Quick29-Jan-06 10:18 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 10:31
protectorChristian Graus29-Jan-06 10:31 
GeneralRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 11:09
Joshua Quick29-Jan-06 11:09 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 11:45
protectorChristian Graus29-Jan-06 11:45 
Questionassigning objects a name programmatically Pin
usernamed29-Jan-06 9:37
usernamed29-Jan-06 9:37 
AnswerRe: assigning objects a name programmatically Pin
Guffa29-Jan-06 9:55
Guffa29-Jan-06 9:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.