Click here to Skip to main content
15,922,584 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: How to show excel inside a window form? Pin
Eddy Vluggen16-Dec-10 4:53
professionalEddy Vluggen16-Dec-10 4:53 
QuestionProgramming of interactive desktop background Pin
hansdam9-Dec-10 7:58
hansdam9-Dec-10 7:58 
AnswerRe: Programming of interactive desktop background Pin
Eddy Vluggen9-Dec-10 9:11
professionalEddy Vluggen9-Dec-10 9:11 
QuestionReading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) [modified] Pin
Ger Hayden8-Dec-10 9:50
Ger Hayden8-Dec-10 9:50 
AnswerRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
DJ Matthews8-Dec-10 9:58
DJ Matthews8-Dec-10 9:58 
GeneralRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
Ger Hayden8-Dec-10 17:51
Ger Hayden8-Dec-10 17:51 
GeneralRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
Richard MacCutchan8-Dec-10 23:41
mveRichard MacCutchan8-Dec-10 23:41 
QuestionHow can I have multiple datasources in the same datagridview combo column [modified] Pin
Ger Hayden29-Nov-10 18:16
Ger Hayden29-Nov-10 18:16 
In the 24 hours since my original post I have made no progress and huge progress. None in that the problem persists, but I have learned volumes about how the combo column behaves.

Here is my original post:
My application reads bus routes into a combo column on a datagrid view. For each Route the Stages column is reloaded.
Each Passenger on Route 1 has its correct stage displayed, but the grid fails to show the stages for passengers on Route 2.

When I step through the code, I can see the Stage column reload and the correct stage picked from the list for Route 2, but its never shown. Not only that, it throws in the Datagrid View Default Error Dialog for good measure.

I am using VS2008, C++/CLI grid is entirely unbound and I am not employing datasoures, so setting displaymember/valuemember is not available to me.

void VTPassenger::frmPassengerMaster::Load_RouteStages(int arg_Route_ID)
{
dgStage->Items->Clear();
dgStage->Items->Add("0 <--- Undefined --->");

// then the Stages for this Route
List<CRouteStage^>^ RouteStageList = gcnew List<CRouteStage^>();
try
{
RouteStageList = CComs_RS::Fetch_RouteStage(m_LocalConnection,1,arg_Route_ID);
}
catch(Exception ^e)
{
String ^MessageString = " SQL Error retrieving Route Stages: " + e->Message;
MessageBox::Show(MessageString, "RouteStage Techincal Error");
return;
}
if (RouteStageList->Count == 0)// No records so no Ticket types defined
{
return;
}

for each(CRouteStage^ candidate in RouteStageList)
{
array<Object^>^ itemRec = gcnew array<Object^> {candidate->p_Stage_ID,
candidate->p_StageName
};

String^ AddString;
AddString = String::Format("{0} - {1}", candidate->p_Stage_ID, candidate->p_StageName);
this->dgStage->Items->Add(AddString);


}

}

And now for the progress.
This will work very well as is if the passenger list is sorted in route order, but do not consider this a suitable workaround. Learning that forced me to reflect on the design. For five hundered passengers distributed over a pair of short routes, 500 database visits doesnt make sense for essentially the same route stages - but what if there were 300 routes involved for our little outfit? Then front loading and holding 300 sets of route stages in a collection in memory doesn't sit well.

So programmatically I have created a datatable and read in my route stages upon which I attempted a filter in the sytle of spidernet's DataGridView FAQ bound in the code to the datatable, but changing the contents of the filter for each route change plus searching the list threw up issues.

So now I have two choices - a collection of filtered stage sets, one per route which will work well while the number of routes operated is low, or expand on my original idea but attempt to implement it a cell level - where I have just commenced research.
Ger
modified on Tuesday, November 30, 2010 11:51 PM

AnswerRe: How can I have multiple datasources in the same datagridview combo column Pin
RobCroll4-Dec-10 16:09
RobCroll4-Dec-10 16:09 
GeneralRe: How can I have multiple datasources in the same datagridview combo column Pin
Ger Hayden8-Dec-10 17:53
Ger Hayden8-Dec-10 17:53 
QuestionToolstripbutton not validating textbox. Pin
priyamtheone23-Nov-10 5:12
priyamtheone23-Nov-10 5:12 
AnswerRe: Toolstripbutton not validating textbox. Pin
RobCroll26-Nov-10 3:30
RobCroll26-Nov-10 3:30 
AnswerRe: Toolstripbutton not validating textbox. Pin
RaviRanjanKr18-Dec-10 20:50
professionalRaviRanjanKr18-Dec-10 20:50 
GeneralRe: Toolstripbutton not validating textbox. Pin
priyamtheone19-Dec-10 3:47
priyamtheone19-Dec-10 3:47 
GeneralRe: Toolstripbutton not validating textbox. Pin
phil.o19-Dec-10 21:15
professionalphil.o19-Dec-10 21:15 
QuestionProblems Dynamically Moving Controls On WinForm Pin
oracleConvert18-Nov-10 9:42
oracleConvert18-Nov-10 9:42 
AnswerRe: Problems Dynamically Moving Controls On WinForm Pin
Luc Pattyn18-Nov-10 10:02
sitebuilderLuc Pattyn18-Nov-10 10:02 
GeneralRe: Problems Dynamically Moving Controls On WinForm Pin
oracleConvert19-Nov-10 4:25
oracleConvert19-Nov-10 4:25 
AnswerRe: Problems Dynamically Moving Controls On WinForm Pin
RobCroll19-Nov-10 1:41
RobCroll19-Nov-10 1:41 
AnswerRe: Problems Dynamically Moving Controls On WinForm Pin
Dave Kreskowiak19-Nov-10 3:16
mveDave Kreskowiak19-Nov-10 3:16 
GeneralRe: Problems Dynamically Moving Controls On WinForm Pin
Luc Pattyn19-Nov-10 3:32
sitebuilderLuc Pattyn19-Nov-10 3:32 
GeneralRe: Problems Dynamically Moving Controls On WinForm Pin
Dave Kreskowiak19-Nov-10 7:07
mveDave Kreskowiak19-Nov-10 7:07 
QuestionProblem in button (.Net 2008, Framework 3.5). Pin
priyamtheone13-Nov-10 2:37
priyamtheone13-Nov-10 2:37 
AnswerRe: Problem in button (.Net 2008, Framework 3.5). Pin
Dr.Walt Fair, PE13-Nov-10 10:45
professionalDr.Walt Fair, PE13-Nov-10 10:45 
AnswerRe: Problem in button (.Net 2008, Framework 3.5). Pin
Eddy Vluggen13-Nov-10 11:26
professionalEddy Vluggen13-Nov-10 11:26 

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.