PDA

View Full Version : چند سوال درباره گرید جانوس



swallow.pa
پنج شنبه 31 فروردین 1391, 07:27 صبح
سلام به همه
من چند سوال درباره گرید جانوس دارم
1- چطور می تونم اعداد را سه رقم سه رقم جدا کنم
2- چطور می تونم رنگ فونت یک سلول رو عوض کنم
3-یک باتن به سلول اضافه کردم رویدادهایش کجاست
4- نحوه کنترل خطا با این کرید چطوریه
5-هر سلول که عددی چطوری تنظیم کنم که عدد تایپ بشه رشته نزنن
6-با کلید انتر کاربر به سمت چپ یا راست بره
7-استایل زیبا داشته باشه چطوری انجام بدم
ممنون

saeidfar
یک شنبه 03 اردیبهشت 1391, 08:44 صبح
در مورد سوال1:
Use a numeric InputMask and the control will handle the period from the numerical keypad as decimal separator.

saeidfar
یک شنبه 03 اردیبهشت 1391, 08:47 صبح
در مورد سوال2:

GridEXFormatStyle cellStyle = new GridEXFormatStyle();
cellStyle.ForeColor = Color.Red;
gridEX1.CurrentRow.Cells[e.Column].FormatStyle = cellStyle;

saeidfar
یک شنبه 03 اردیبهشت 1391, 08:51 صبح
ادامه سوال 2:
You can change the Forecolor and font properties. Backcolor of the cell will remain being the backcolor of group rows for the style. To change the format, do it in the FormattingRow event as follows:


void gridEX1_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
{
if (e.Row.RowType == Janus.Windows.GridEX.RowType.GroupFooter)
{
if (Convert.ToDecimal(e.Row.Cells["X"].Value) < 0)
{
Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
style.ForeColor = Color.Red;
e.Row.Cells[0].FormatStyle = style;
}
}
}

saeidfar
یک شنبه 03 اردیبهشت 1391, 09:02 صبح
یک باتن به سلول اضافه کردم رویدادهایش کجاست
فكر كنم براي اين باتن محدوديت داريد فقط چند حالت داره چون فقط براي ركورد جاري نوشته ميشه پس يا بايد حذف، ويرايش و يا اضافه كردن باشه و اين ها رو ميتونيد از اينجا يه جورايي متوجه بشيد:
For BeginingRowEdit event, you can use the FirstChange event. This event is raised
when the user makes the first change in a row (when a row edit begins)
For EndingRowEdit event, use UpdatingRecord/RecordUpdated, the event is raised when the control is updates the changes in the datarow. They should not be fired when the when the user cancels edition, if you are seeing this, please send us a sample project where we can reproduce that behavior.
For CancelingRowEdit, use CancelingRowEdit event. However, the event won't be raised when the edit is canceled in code.
For IsEditingCurrentRow property, use DataChanged property.

saeidfar
دوشنبه 04 اردیبهشت 1391, 09:21 صبح
اينم لينك آموزش فارسي كار با جانوس
http://freecomponents.blogfa.com/cat-6.aspx

Leila-2011
سه شنبه 05 شهریور 1392, 09:43 صبح
من یه کاری توی گرید جانوس باید انجام بدم ولی نمیدونم چطوری ، چیزی که میخام اینه :
یه گرید جانوس دارم که سه تا ستون اولش مقدار دارن و دو ستونه بعد با value list کار شده و کاربر باید مقداری رو انتخاب کنه من میخام که توی رویداد cell update این دو ستون دستوری بنویسم که وقتی کاربر چیزی رو وارد میکنه یا تغییر میده همین مقدار برای تمام سلول های دیگه ای که ستون اول و دومشون با هم برابرن اعمال شه و لازم نباشه که کاربر خودش برای تمام سلولهایی که در ستون اول و دوم برابر هستن دستی این تغییرات رو انجام بده

Leila-2011
سه شنبه 05 شهریور 1392, 12:03 عصر
انجامش دادم با همچین کدی ، خیلی آسون بود :چشمک: :لبخندساده:


string MTAssembly1 = this.gridEXAssProperty.GetValue(2).ToString();
string MTCounter1 = this.gridEXAssProperty.GetValue(3).ToString();
string MTQCIns = this.gridEXAssProperty.GetValue(5).ToString();
string MTOperator = this.gridEXAssProperty.GetValue(6).ToString();
for (int i = 0; i < this.gridEXAssProperty.RowCount; i++)
{
this.gridEXAssProperty.Row = i;
string MTAssembly2 = Convert.ToString(this.gridEXAssProperty.GetValue(2 ));
string MTCounter2 = Convert.ToString(this.gridEXAssProperty.GetValue(3 ));
if ((MTAssembly2 == MTAssembly1) && (MTCounter2 == MTCounter1))
{
this.gridEXAssProperty.SetValue(5, MTQCIns);
this.gridEXAssProperty.SetValue(6, MTOperator);
}