Custom Modules

Snippets

25

                    ListItem lisource = ddlDonationSource.Items.FindByValue(item.Source);
                    if (lisource != null)
                    {
                        // value found - select it
                        ddlDonationSource.SelectedValue = item.Source;
                    }
                    else
                    {
                        //Value not found - add it and then select it
                        ddlDonationSource.Items.Insert(1, new ListItem(item.Source, item.Source));
                        ddlDonationSource.SelectedValue = item.Source;
                    }

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.