ارور Object Referece set to an instance of an object در master detail
سلام , وقت بخیر.
من تویه فرمم دو تا گرید دارم به صورت Master Detail. تویه رویداد SelectionChange گرید بالا وقتی کلیک میشه میرم و یه کوئری میزنم و اطلاعات رو فیلتر میکنم تویه گرید پایینی.
ولی وقتی رویه هر کدوم از هدرهای ستون گرید اول کلیک میکنم ارور Object Reference میده .
چطور میتونم رفعش کنم ؟
نقل قول: ارور Object Referece set to an instance of an object در master detail
با سلام
من توی نرم افزارم گذاشتم و هیچ مشکلی نداره
یک نمونه کوچیک اینجا قرار بدید تا تست بشه و یک شرط در رویداد SelectionChanged قرار بدید
if (dataGridView1.RowCount != 0)
{
//Select Code...
}
موفق باشید
نقل قول: ارور Object Referece set to an instance of an object در master detail
با کد زیر و کمک آقای Mahmoud-Zaad حلش کردم .
تویه رویداد SelectionChanged این رو نوشتم :
if (DGV1.SelectedRows.Count>0)
{
ShowDGVPerson();
}