|
Just for information, are you developing data warehouse?
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
I'm Having a combobox which having items from itemtable. When table is empty then I have to show "No items" and if items are their in table then I have to show the item. So I fill datatable like
if (dataTableItems.Rows.Count >= 1)
{
cmbItem.Items.Clear();
cmbItem.DataSource = dataTableItems;
cmbItem.DisplayMember = dataTableItems.Columns["ItemName"].ColumnName;
}
else
{
cmbItem.Items.Clear();
cmbItem.Items.Add("No items");
cmbItem.Text = "No items";
}
This is working fine on form's load event.
But I have a button that will get items from other datatsource and fill the item tables. On click of the button I again fill the datatable and same code
if (dataTableItems.Rows.Count >= 1)
{
cmbItem.Items.Clear();
cmbItem.DataSource = dataTableItems;
cmbItem.DisplayMember = dataTableItems.Columns["ItemName"].ColumnName;
}
else
{
cmbItem.Items.Clear(); <-- ERROR COME HERE
cmbItem.Items.Add("No items");
cmbItem.Text = "No items";
}
But it will give error "Items collection cannot be modified when the DataSource property is set."
please help
Regards
Pankaj Joshi
|
|
|
|
|
First you should set the combobox's datasource to nothing:
cmbItem.DataSource = string.Empty;
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Giving error
"Complex Databinding accepts as a datasource either as IList or an IListSource"
Regards
Pankaj Joshi
|
|
|
|
|
I tried a lot and finally write this
cmbItem.DataSource = null;
This is working fine.
Will it create problem in the future...? Please reply...:->
Dear Christian Graus your suggestion needed this time...
Regards
Pankaj Joshi
|
|
|
|
|
Wow. It's urgent with three exclamations. That makes it much more likely to get answered quickly. Wait, if I post urgent and put four exclamations in, does this mean my question will get answered before yours?
Now, please post questions with meaningful titles and respect the fact that these boards are looked after by volunteers who will get to your problem when they are ready. If your problem really is that urgent, then you should probably seek an answer in an area where people get paid to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for your suggestion
Regards
Pankaj Joshi
|
|
|
|
|
Maybe the forums should support canned responses. So you don't have to type the same messsage about "cross-post" or "urgent" posts 20 times a day
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Edit Grid View
-- modified at 5:44 Thursday 15th November, 2007
|
|
|
|
|
Paramita07 wrote: Edit Grid View
Any questions there?
I will use Google before asking dumb questions
|
|
|
|
|
Set IsEditable Property true!!!
Regards
Pankaj Joshi
|
|
|
|
|
yes its workng
|
|
|
|
|
i need to send and receive file from a dial-up connection
i want to use modem in both machines for transfer files
let me know if there is some example about it or other good stuf
thanks
-- modified at 8:10 Thursday 15th November, 2007
|
|
|
|
|
The connection is irrelevant, you need to connect to another machine that has the file, and request it. Do you have an IP address and path to the file ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i want to use modem to send and receive files and not from internet!!
|
|
|
|
|
|
i want to use modem to send and receive files and not from internet!!
|
|
|
|
|
Hello *,
I would like to ask you how I can add system time from Windows to my application.
I would like to show to user actual time of Windows to the application bar
as it's shown in standart taskbar.
regards
Petr
|
|
|
|
|
Set a timer to fire twice a second and set the text to be DateTime.Now
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Where can I get sample code that will explain how a simple web service works?
|
|
|
|
|
msdn.microsoft.com, or even the articles on this site.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Garth Styer wrote: Where can I get sample code that will explain how a simple web service works?
GOOGLE
W3Schools.com
I will use Google before asking dumb questions
|
|
|
|
|
|
Hi friends,
Briefly, I am working on runtime application. I have 10 buttons with their bacground images.
On first click,I want to see any button's backgrounimages. On second click, I want to
close this background image.
I constucted 10 buttons and gave their bacgound images. Now, When I make first click to the
button, I want to see button's background images. On second click, I want to close this
backgoundimage. I am using one image variable to keep first backgroundimage. The problem is
that, by using one image variable, I can keep only one button's backgrounimage but I have 10
buttons. What can I do to keep all buttons's backgrounimages. I think, using 10 image variables
for 10 buttons isn't right way. Is there any simple and logical way to make this.
-- modified at 5:47 Thursday 15th November, 2007
|
|
|
|