Jump to content

Devexpress Datargrid Filtreleme Hatası


muratboy31
 Share

Recommended Posts

  • Editor

Kullandıgınız devexpress sürümünde bir problem olabilir.

 

Eğer RowExpand eventında bir kod yazmadıysanız muhtemelen devexpress sürümünüzden kaynaklı.

 

Bu tür buglar bir sonraki sürümde düzeltilir eğer son sürüm kurmadıysanız son sürüm bir devexpress kurabilirsiniz.

Link to comment
Share on other sites

Arkadaşlar merhaba,

sorun bundan kaynaklı, bu kodu kaldırınca sorunsuz çalışıyor ancak display text olmuyor yane sadece rakam geliyor Dolar, Euro yada TL olarak göremiyorum...

Bunu nasıl aşabilirim acaba ?

private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            try
            { 
            CultureInfo USD = new CultureInfo("en-US");
            CultureInfo EUR = new CultureInfo("fr-FR", false);
            CultureInfo TL = new CultureInfo("tr-TR", false);

            ColumnView view = sender as ColumnView;
            if (e.Column.FieldName == "Onaylanan" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
            {
                string currencyType = view.GetRowCellValue(e.ListSourceRowIndex, gridView1.Columns["Para_Birimi"]).ToString();
                decimal para = Convert.ToDecimal(e.Value);
                switch (currencyType)
                {
                    case "USD": e.DisplayText = string.Format(USD, "{0:C}", para); break;
                    case "TL": e.DisplayText = string.Format(TL, "{0:C}", para); break;
                    case "EUR": e.DisplayText = string.Format(EUR, "{0:C}", para); break;
                }
            }

            if (e.Column.FieldName == "Gerceklesen" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
            {
                string currencyType = view.GetRowCellValue(e.ListSourceRowIndex, gridView1.Columns["Para_Birimi"]).ToString();
                decimal para = Convert.ToDecimal(e.Value);
                switch (currencyType)
                {
                    case "USD": e.DisplayText = string.Format(USD, "{0:C}", para); break;
                    case "TL": e.DisplayText = string.Format(TL, "{0:C}", para); break;
                    case "EUR": e.DisplayText = string.Format(EUR, "{0:C}", para); break;
                }
            }
            if (e.Column.FieldName == "Kalan" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
            {
                string currencyType = view.GetRowCellValue(e.ListSourceRowIndex, gridView1.Columns["Para_Birimi"]).ToString();
                decimal para = Convert.ToDecimal(e.Value);
                switch (currencyType)
                {
                    case "USD": e.DisplayText = string.Format(USD, "{0:C}", para); break;
                    case "TL": e.DisplayText = string.Format(TL, "{0:C}", para); break;
                    case "EUR": e.DisplayText = string.Format(EUR, "{0:C}", para); break;
                }
            }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }
Link to comment
Share on other sites

ama gelen veri numeric üçünde de, sadece filtre yaparken sorun oluyor !!!

 


çözdüm sanıyorum :)

object currencyType = view.GetListSourceRowCellValue(e.ListSourceRowIndex, "Para_Birimi");

şimdilik sorun yok gibi...

Edited by muratboy31
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...