I have developed a sniffer code in C language. Now i am creating user interface for that. I am using visual C++ to design user interface. Once the program starts it stores each packets ip address, port number , protocol type ,time etc in respective variables. Now i want to display these values in a tabluar format. So i choose datagridview. How to proceed, i am unable to insert the values in cell, msdn didnt helpful..kindly help.
devfeel
0
Newbie Poster
Recommended Answers
Jump to PostCertain collections are naturally suited to a DataGridView -- like a List<T^>.
If I use a List<KeyValuePair<String^, String^>>^, I can store data in the DataGridView without additional manipulation:System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { List<KeyValuePair<String^, String^>>^ lst_kvp_s2s = gcnew List<KeyValuePair<String^, String^>>(); // lst_kvp_s2s->Add(KeyValuePair<String^, String^>("President", "Dave")); lst_kvp_s2s->Add(KeyValuePair<String^, String^>("Vice …
Jump to PostDevfeel... Uhm, I dont want to sound rude but how can that be such a big problem?
converting and datatype shuffeling and loading into lists is something that should be rather simple if you managed the program you mentioned above?
thines01's advice is solid and will give you exactly what …
Jump to PostNot a problem:
System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { const char* arr_pstrTitles[] = {"President", "Vice President", "Secretary"}; int arr_intYears[] = {3, 2, 6}; List<KeyValuePair<String^, int>>^ lst_kvp_s2i = gcnew List<KeyValuePair<String^, int>>(); // for(int i=0; i<3; i++) { lst_kvp_s2i->Add(KeyValuePair<String^, int>( gcnew String(arr_pstrTitles[i]), arr_intYears[i])); } // dataGridView1->DataSource = lst_kvp_s2i; } …
All 10 Replies
thines01
401
Postaholic
Team Colleague
Featured Poster
devfeel
0
Newbie Poster
Eagletalon
34
Junior Poster in Training
thines01
401
Postaholic
Team Colleague
Featured Poster
devfeel
0
Newbie Poster
Eagletalon
34
Junior Poster in Training
devfeel
0
Newbie Poster
Eagletalon
34
Junior Poster in Training
devfeel
0
Newbie Poster
k_8
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.