الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تغيير لون Row في DataGride

مغلق
بدأه musaireae في 28 أبريل 2006 · 12 رد · 869 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمه الله و بركاته

اما بعد فأود تغيير لون Row معين في DataGride في حدث Load على حسب قيمه معينه ، فيكن اتمكن من تغيير لون Row .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#2

على إفتراض انا عاوز ألون أول row فى الgrid

for (int j = 0; j < tblFillGrid.Columns.Count; j++)
                {
                     grdInfo.Rows[0].Cells[j].Style.BackColor = System.Drawing.Color.Blue;
                }

Muhammad Allam

Computer Science

@Resource(MappedURL="My Blog" )

#3

اخي الفاضل هل انت متاكد من ان الكود السابق يعمل لانك قد قمت بوضع متغير في الفور لوب غير المتغير الذي بداخل الفور لوب ، علاوه على ان dataGrid لايوجد لها من المثود الخاصه بها Row و Columns .

ارجو منك يا اخي الفاضل اما التاكد من الكود او ارسال كود موضوع فيه الكود الخاص بك يعمل .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#4

لا الكود شغال ومية مية بس ينقص لة حبة توضيح

بالنسبة

tblFillGrid إسم الDataTable اللى أنا ماليتة من الDB

grdInfo إسم الDataGrid

//3 mean number of columns
for (int j = 0; j < 3; j++)
               {
//change color of First row =>row[0]
                    grdInfo.Rows[0].Cells[j].Style.BackColor = System.Drawing.Color.Blue;
               }

Muhammad Allam

Computer Science

@Resource(MappedURL="My Blog" )

#5

اخي هل قمت بتجربه السطر

 grdInfo.Rows[0].Cells[j].Style.BackColor

لانني جربته و لا يعمل لان dataGride لا يوجد لها خاصيه Row

هل يحتاج ان اضيف مكتبه او ان استخدم شي اضافي .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#6

الRows property موجودة فى c#2.0

اقتباس
Gets a collection that contains all the rows in the DataGridView control

ودة مثال ب2003 Changing the background color of cells in a DataGrid

Muhammad Allam

Computer Science

@Resource(MappedURL="My Blog" )

#7

أخي eng_allam شكرا لك على ردودك

أنا أستعمل C1TrueDataGrid

لا بد أنك تعرفها............هل أستطيع تطبيق هذا الموضوع عليها؟ وكيف؟؟؟

أنا أيضا بحاجة للرد على هذا الموضوع فقد كنت أريد أن أسأل عنه لكن الاخ سبقني

My_Sign.jpg
#8

اشكرك اخي eng_3llam على المجهود و يعطيك الله الف عافيه .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#10

يا اخي اودت ان استفسر عن كيفيه وضع عنوان لل Data Gride في 2005 لانه في 2003 يوجد خاصيه CaptionText من خلالها تمكنك من وضع لل data gride وضع عنوان لها .

كيف اعمل ذلك في 2005 .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#11

هل ممكن ان اعمل الطلب السابق في 2005 ام لا .

ارجو المساعده .

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

#12

يا أخي , الـ DataGrid الموجوده في 2005 هي تماما نفسها الموجوده في الـ 2003 , وهم أصلا وضعوها في الـ 2005 كما هي تماما من أجل الـ Backward Campatibility ولذلك فمستحيل أنهم يكونوا غيروا فيها حاجات والا كان سيصبح اضافتها للـ 2005 مالوش لازمه , لأنه يوجد DataGridView وهي تقوم بنفس وظائفها بالاضافه الى مميزات.

#Read

http://MoutazShams.blogspot.com

projects003.gif

أعتذر عن التغيب هذه الأيام نظرا للانشغال المريب

#13

يا اخي انا بحثت في 2005 عن المر المقابل في العمل للامر الموجود في الاسفل و لم اجد .

فما الامر الذي يلعب نفس الدور في dataGridView1 .

dataGrid1.CaptionText = "معلومات الفريق العربي";

If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.

هذا الموضوع مغلق.

مواضيع مشابهة