korasoglu Posted June 20, 2017 Share Posted June 20, 2017 Arkadaşlar gridcontrol de secilen satırları nasıl alabilirim RepositoryItemCheckEdit chxEdit = new RepositoryItemCheckEdit(); DevExpress.XtraGrid.Columns.GridColumn gc = new DevExpress.XtraGrid.Columns.GridColumn(); gridView1.Columns.Add(gc); gc.Caption = "Seç"; //gc.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; gc.OptionsColumn.AllowEdit = true; gc.VisibleIndex = 0; gc.OptionsColumn.AllowSize = true; // gc.UnboundType = DevExpress.Data.UnboundColumnType.Boolean; // chxEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked; chxEdit.CheckStyle = CheckStyles.Standard; // chxEdit.ValueChecked = true; // chxEdit.ValueUnchecked = false; gc.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gc.AppearanceHeader.Options.UseFont = true; gc.AppearanceHeader.Font = new System.Drawing.Font("Tahoma", 9); gc.ColumnEdit = chxEdit; gridView1.Columns[0].Width = 15; gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; gridView1.OptionsSelection.MultiSelect = true; gridView1.Columns[0].MaxWidth = 30; Quote Link to comment Share on other sites More sharing options...
korasoglu Posted July 8, 2017 Author Share Posted July 8, 2017 125 okunma var bir yorum yok garip Quote Link to comment Share on other sites More sharing options...
xmen14 Posted July 8, 2017 Share Posted July 8, 2017 Bilgisayardan bakarsam ancak bilgi verebilirim uzaktayım şu anda kusura bakma.LG-H850 cihazımdan Tapatalk kullanılarak gönderildi Quote Link to comment Share on other sites More sharing options...
korasoglu Posted July 19, 2017 Author Share Posted July 19, 2017 Alıntı LG-H850 cihazımdan Tapatalk kullanılarak gönderildi Senin LG-H850 Cihazı çok mereak ettim hiç normal göndermiyor Quote Link to comment Share on other sites More sharing options...
xmen14 Posted July 19, 2017 Share Posted July 19, 2017 Olmazsa akşama bakarımLG-H850 cihazımdan Tapatalk kullanılarak gönderildi Quote Link to comment Share on other sites More sharing options...
Extended Posted July 19, 2017 Share Posted July 19, 2017 Şöyle bişey yazdım deneyebilirsin. foreach(DataGridViewRow item in gridView1.SelectedRows) { //item.Index ile indexini alırsın // tem.Cells[0].ToString() 0. kolonun içeriği olması lazım } Quote Link to comment Share on other sites More sharing options...
xmen14 Posted July 19, 2017 Share Posted July 19, 2017 Chekcbox olan satırı mı okuyacaz sadece yoksa hepsini miLG-H850 cihazımdan Tapatalk kullanılarak gönderildi Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 2, 2017 Share Posted August 2, 2017 @Extended senin verdiğin kod dataGridView için, arkadaşın istediği Devexpress GridControl için. @xmen14 evet satırdaki hücre değerini okumanız gerekiyor. // repositoryItem'in seçili value'sinin alacağı değer true olarak ayarlanmış chxEdit.ValueChecked = true; // ona göre işlem yapalım for (int i = 0; i < gridView1.RowCount; i++) { string deger = gridView1.GetRowCellDisplayText(i, gridView.Columns[0]); bool secilimi Convert.ToBoolean(deger); if (secilimi == true) { // satır seçili } } Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 2, 2017 Author Share Posted August 2, 2017 Hocam bool secilimi Convert.ToBoolean(deger); if (secilimi == true) bu satırları çizdi bir örnek verebilirseniz sevinirim Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 2, 2017 Share Posted August 2, 2017 chxEdit.ValueChecked = true; yaptığınız için gelen değeri Boolean türüne çevirmeniz lazım ki seçili mi seçili değil mi anlayabilesiniz. Yapamazsanız Pm ile team bilgileri gönderin bakalım Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 2, 2017 Author Share Posted August 2, 2017 Hocam illa bu örnek diye takılma ben checkbox columns ekleme ve eklenen o sütündaki seçilen satırları bilmek veya indexini istiyorum. ali.Columns.Add("id"); ali.Columns.Add("ad"); isa.Columns.Add("avci"); for (int i = 0; i < 10; i++) { isa.Rows.Add(i); } isa.Columns.Add(new DataColumn("OK", Type.GetType("System.Boolean"))); gridControl1.DataSource = isa; private void button1_Click(object sender, EventArgs e) { string value = ""; ali.Rows.Clear(); dataGridView1.DataSource = null; dataGridView1.Rows.Clear(); dataGridView1.Columns.Clear(); for (int i = 0; i < gridView1.RowCount; i++) { value = gridView1.GetDataRow(i)["OK"].ToString(); if (value.ToString() == "True") { ali.Rows.Add(i, gridView1.GetRowCellValue(i, "avci").ToString()); dataGridView1.DataSource = ali; } } } Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 3, 2017 Editor Share Posted August 3, 2017 (edited) Please register to see this content. Kısaca bu şekilde halledebilirsiniz. Run Designer a girip InPlace Editor den checkbox eklemeyi unutmayın. Edited August 3, 2017 by pairs Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 6, 2017 Author Share Posted August 6, 2017 (edited) pairs örnek bende açılmadı Riibon panele buton ekleyip denedim seçilenleri bir eksik veriyor ama normal butonda doğru veriyor Please register to see this content. Edited August 6, 2017 by korasoglu Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 6, 2017 Editor Share Posted August 6, 2017 Devexpress ile alakalı bir hata bu. Muhtemelen aynı sürüm değiller. Yukarıdaki devexpress sekmesinden project converter ı seçip projeyi çevirirsen duzelir. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 6, 2017 Author Share Posted August 6, 2017 pairs hata nerede bir bakarsan sevinirim Daha önceki denemelerimde de aynı sorunla karşılaşmıştım. Ribbon eklemeden önce seçilenleri aldım ribbon ekleyip denedim o zamanda aynısı olmuştu bir püf noktası oması gerek ama ne... Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 6, 2017 Author Share Posted August 6, 2017 Sitede sorunmu var bende zor load yapıyor Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 7, 2017 Editor Share Posted August 7, 2017 Please register to see this content. Bu ekran açıldıktan sonrada upgrade derseniz düzelecektir hata. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 7, 2017 Author Share Posted August 7, 2017 Sevgili pairs bu hatadanmı bahsediyorsun Riibon panele buton ekleyip denedim seçilenleri bir eksik veriyor ama normal butonda doğru veriyor Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 7, 2017 Editor Share Posted August 7, 2017 Ben gridcontrol için dediğiniz hatadan bahsettim . diğer probleminiz nedir bilmiyorum. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 7, 2017 Author Share Posted August 7, 2017 hata rarda örnek proje var ribbon paneldeki buton aracılığıyla seçili kontrol ettinmi hatalı normal butonla yaptınmı doğru veriyor saçma bir hata inceleme şansın olursa çok sevinirim. Sonuç olarak aynı kod farklı sonuç veriyor Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 7, 2017 Editor Share Posted August 7, 2017 teamviewer yada başka bir programla bağlantı gönderirseniz bakabilirim. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted July 2, 2018 Author Share Posted July 2, 2018 Arkadaşlar multiselect = true ve multiselectmode = CheckBoxRowSelect tüm sütün seçilebiliyor ben seçili satırları nasıl alabilirim. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted July 2, 2018 Author Share Posted July 2, 2018 Arayanlar olursa çözümü arkadaşlar void Liste() { ArrayList rows = new ArrayList(); Int32[] selectedRowHandles = gridView1.GetSelectedRows(); for (int i = 0; i < selectedRowHandles.Length; i++) { int selectedRowHandle = selectedRowHandles; if (selectedRowHandle >= 0) rows.Add(gridView1.GetDataRow(selectedRowHandle)); } try { gridView1.BeginUpdate(); for (int i = 0; i < rows.Count; i++) { DataRow row = rows as DataRow; MessageBox.Show(row["Satir"].ToString()); } } finally { gridView1.EndUpdate(); } } Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted July 10, 2018 Editor Share Posted July 10, 2018 korasoglu, 02.07.2018 - 16:00 yazdı: int selectedRowHandle = selectedRowHandles; Array bir integer ı normal integer değişkene nasıl atadın. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted July 15, 2018 Author Share Posted July 15, 2018 Çalışıyor peki doğrusu nasıl olmalıdır netice konuya hakim olsam soru sormam ama uzun yoldandan sonuca vardı fakat daha basit yapılabilmesi lazım. Proje iş yerinde yarın atarım. Sevgili pairs şimdi tekrar baktım seçilen satirlerın int değerleri depolanıyor yani mantık doğru değilmi. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.