This is a migrated thread and some comments may be shown as answers.

[Solved] Radcombobox Validations for selecting Exisitng values in the Item collection

0 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jaladi
Top achievements
Rank 1
jaladi asked on 19 Jul 2012, 10:20 AM
hi

I have been working with this from past one week,but i am unable to validate the radcombobox 

Acutally,

Binding the values from the dataset like the below

 public DataSet GetZipValue(string str)
        {
            StringBuilder sb = new StringBuilder();
            DataSet ds = new DataSet();
            try
            {
                sb.Append("EXEC Spzip @zip='");
                sb.Append(str);
                sb.Append("'");
                ds = LoginParams.GetSQL(sb.ToString(), login.ConnectionString(), "zip", CommandTimeOut);

            }
            catch (Exception ex)
            {
             
            }
            finally
            {
                sb = null;
            }
            return ds;
        }

        protected void radZipCode_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            try
            {
                e.Item.Text = ((DataRowView)e.Item.DataItem)["Zip"].ToString();
                e.Item.Value = ((DataRowView)e.Item.DataItem)["City"].ToString();

                e.Item.Attributes["Zip"] = ((DataRowView)e.Item.DataItem)["Zip"].ToString();
                e.Item.Attributes["City"] = ((DataRowView)e.Item.DataItem)["City"].ToString();
                e.Item.Attributes["State"] = ((DataRowView)e.Item.DataItem)["State"].ToString();
               
            }
            catch (Exception ex)
            {
           
            }
        }

        protected void radZipCode_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {

            try
            {
                if (e.Text.Length > 1)
                {
                    RadComboBox combo = (RadComboBox)o;
                    DataSet ds = new DataSet();
                    ds = GetZipValue(e.Text);
                    combo.DataSource = ds.Tables[0];
                    combo.DataBind();
                }

            }
            catch (Exception ex)
            {
             
            }
        }
    }


Problem is :

how to validate the radcombobox that the selected item (after the obclientblur event)is matched with the DATASETgetting from backend..?


if it is matched the value is TRUE

other wise false value returns...




Tags
Grid
Asked by
jaladi
Top achievements
Rank 1
Share this question
or