TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Zakir Ahamed
NA
1.4k
625.9k
i have a problem in chekedListBox to bind a data
Aug 7 2017 3:37 AM
hi friends ,
i have a problem Checkedlist box To bind a data what i have saved in grid..
i want to bind the data i was saved for updATION CHANGES..
my code:
private void GvCategory_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
try
{
indexRow = e.RowIndex;
DataGridViewRow row = GvCategory.Rows[indexRow];
txtcategory.Text = row.Cells[1].Value.ToString();
//txtcategory.ReadOnly = true;
btncategory.Text = "Update";
rbyes.Checked = true;
if (txtcategory.Text != " ")
{
try
{
Hashtable hash = new Hashtable();
hash.Add("@status","Brand");
hash.Add("@categoryname",txtcategory.Text);
DataTable dtLoad = DataAccessLayer.GetDataTable("Category_Mst_sp", hash);
string[] s = new string[] {};
if (dtLoad != null && dtLoad.Rows.Count > 0)
{
for (int i = 0; i < dtLoad.Rows.Count; i++)
{
s = dtLoad.Rows[i]["BrandId"].ToString().Split(',');
}
for (int i = 0; i < clbbrand.Items.Count; i++)
{
/*Now with the following code we can get valemember and displaymember as per your requirement you can store in table. */
DataRow r;
r = ((DataRowView)this.clbbrand.CheckedItems[i]).Row;
string val = (r[this.clbbrand.ValueMember]).ToString();
string dis = (r[this.clbbrand.DisplayMember]).ToString();
r = null;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if any one help to get data bind in checkedlistbox:
Reply
Answers (
2
)
i cant find the information in list box.can you help me?
How to shift rows left-right or column up-down in datatable