Ara
Generic filters
Exact matches only
Filter by Custom Post Type
Ana Sayfa / Devexpress / Devexpress Vgridcontrol Kullanma

Devexpress Vgridcontrol Kullanma

Devexpress Vgridcontrol Kullanma

Devexpress vgridcontrol kullanımını, hazır ve çalışan kodlar ile kendi projem içerisinden alarak sizlere sunuyorum.

Öncelikle Visual Studio içerisinden formunuza vgridconrol sürükleyin.

Kod ile doldurmak için aşağıdaki kodu form’un load bölümünde çalıştırın;

Kod:

private void Vessel_master_Info()
{

vGridControl1.Rows.Clear();
SqlConnection connection = new SqlConnection(myConnectionString);

//the database is in the web app root!
if (connection.State == ConnectionState.Closed)
{
connection.Open();
}

SqlDataAdapter da = new SqlDataAdapter(“select v.Vm_Callsign,v.Vm_VesselName,v.Vm_VesselFiloCode,v.Vm_VesselTypeCode,v4.FirmName,v.Vm_PortOfRegistry,v.Vm_Flag,v.Vm_DateOfBuild,v.Vm_ShipBuilder ,v.Vm_HullNumber ,v.Vm_ImoNumber,v.Vm_ClassName,Vm_Phone,Vm_Fax,Vm_Fax1,Vm_Fax2,Vm_Telex,Vm_Data,Vm_Mobile,Vm_Mail,vm_mail2,vm_mail3,Vm_ClassName,Vm_ClassRegisterNumber,Vm_LloydNumber,Vm_ClassificationNotation,Vm_ClassCategory,Vm_CLassService,Vm_ClassSpecialNotaions,Vm_ClassPIClub,Vm_ISMClass,Vm_ISPSClass from Vessel_Master v inner join Vessel_Master_Owner_Firm v4 on v.Vm_OwnerCode = v4.Id where v.vm_callsign='” + selectedvessel + “‘”, connection);
DataSet dt = new DataSet();
da.Fill(dt);
DataTable dat = new DataTable();
da.Fill(dat);

CategoryRow category = new CategoryRow();
category.Properties.Caption = “Vessel Information”;

CategoryRow Classification = new CategoryRow();
Classification.Properties.Caption = “Classification”;

CategoryRow COMMUNICATION = new CategoryRow();
COMMUNICATION.Properties.Caption = “COMMUNICATION”;
CategoryRow PARTICULARS = new CategoryRow();
PARTICULARS.Properties.Caption = “PARTICULARS”;
CategoryRow CAPACITIES = new CategoryRow();
CAPACITIES.Properties.Caption = “CAPACITIES”;
CategoryRow PROPELLER = new CategoryRow();
PROPELLER.Properties.Caption = “PROPELLER”;

CategoryRow STEERING = new CategoryRow();
STEERING.Properties.Caption = “STEERING GEAR”;

CategoryRow AUXILARY = new CategoryRow();
AUXILARY.Properties.Caption = “AUXILARY ENGINE”;

CategoryRow CARGO = new CategoryRow();
CARGO.Properties.Caption = “CARGO TANKS”;

CategoryRow ACCOMODATION = new CategoryRow();
ACCOMODATION.Properties.Caption = “ACCOMODATION”;

CategoryRow HEATING = new CategoryRow();
HEATING.Properties.Caption = “HEATING SYSTEM”;

Classification.Expanded = false;
COMMUNICATION.Expanded = false;
PARTICULARS.Expanded = false;
CAPACITIES.Expanded = false;
PROPELLER.Expanded = false;
STEERING.Expanded = false;
AUXILARY.Expanded = false;
CARGO.Expanded = false;
ACCOMODATION.Expanded = false;
HEATING.Expanded = false;
Classification.Expanded = false;
vGridControl1.Rows.Add(category);

vGridControl1.Rows.Add(Classification);
vGridControl1.Rows.Add(COMMUNICATION);
vGridControl1.Rows.Add(PARTICULARS);
vGridControl1.Rows.Add(CAPACITIES);
vGridControl1.Rows.Add(PROPELLER);
vGridControl1.Rows.Add(STEERING);
vGridControl1.Rows.Add(AUXILARY);
vGridControl1.Rows.Add(CARGO);
vGridControl1.Rows.Add(ACCOMODATION);
vGridControl1.Rows.Add(HEATING);

category.ChildRows.Add(editorRow1);
category.ChildRows.Add(editorRow2);
category.ChildRows.Add(editorRow3);
category.ChildRows.Add(editorRow4);
category.ChildRows.Add(editorRow4);
category.ChildRows.Add(editorRow5);
category.ChildRows.Add(editorRow6);
category.ChildRows.Add(editorRow7);
category.ChildRows.Add(editorRow8);
category.ChildRows.Add(editorRow9);
category.ChildRows.Add(editorRow10);
category.ChildRows.Add(editorRow11);
Classification.ChildRows.Add(editorRow12);
Classification.ChildRows.Add(editorRow23);
Classification.ChildRows.Add(editorRow24);
Classification.ChildRows.Add(editorRow25);
Classification.ChildRows.Add(editorRow26);
Classification.ChildRows.Add(editorRow27);

COMMUNICATION.ChildRows.Add(editorRow13);
COMMUNICATION.ChildRows.Add(editorRow14);
COMMUNICATION.ChildRows.Add(editorRow15);
COMMUNICATION.ChildRows.Add(editorRow16);

COMMUNICATION.ChildRows.Add(editorRow18);
COMMUNICATION.ChildRows.Add(editorRow19);
COMMUNICATION.ChildRows.Add(editorRow20);
COMMUNICATION.ChildRows.Add(editorRow21);
COMMUNICATION.ChildRows.Add(editorRow22);

/* CategoryRow rowMain = new CategoryRow(“Main”);

vGridControl1.Rows.Add(rowMain);
// moving the Model row
vGridControl1.MoveRow(categoryRow1, rowMain, false);
// moving the Category row
vGridControl1.MoveRow(editorRow1, categoryRow1, false);
// moving the Trademark row
vGridControl1.MoveRow(editorRow2, categoryRow1, true);

*/

CategoryRow row = category as CategoryRow;
CategoryRow row2 = Classification as CategoryRow;
CategoryRow row3 = COMMUNICATION as CategoryRow;
CategoryRow row4 = PARTICULARS as CategoryRow;
CategoryRow row5 = CAPACITIES as CategoryRow;
CategoryRow row6 = PROPELLER as CategoryRow;
CategoryRow row7 = CARGO as CategoryRow;
CategoryRow row8 = ACCOMODATION as CategoryRow;

CategoryRow row10 = HEATING as CategoryRow;
CategoryRow row11 = STEERING as CategoryRow;
CategoryRow row12 = AUXILARY as CategoryRow;

// modifying the height

// changing the row’s appearance settings
row.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row.Appearance.BackColor2 = Color.Aqua;

row2.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row2.Appearance.BackColor2 = Color.Aqua;

row3.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row3.Appearance.BackColor2 = Color.Aqua;

row4.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row4.Appearance.BackColor2 = Color.Aqua;

row5.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row5.Appearance.BackColor2 = Color.Aqua;

row6.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row6.Appearance.BackColor2 = Color.Aqua;

row7.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row7.Appearance.BackColor2 = Color.Aqua;

row8.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row8.Appearance.BackColor2 = Color.Aqua;

row10.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row12.Appearance.BackColor2 = Color.Aqua;

row11.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row11.Appearance.BackColor2 = Color.Aqua;
row12.Appearance.BackColor = Color.FromArgb(227, 240, 255);
row12.Appearance.BackColor2 = Color.Aqua;

//displaying an image within the header
ImageList images = new ImageList();
images.Images.Add(Image.FromFile(“C:\\AGPSOFT\\AGP\\images\\shipparticular.bmp”));
vGridControl1.ImageList = images;
row.Properties.ImageIndex = 0;
row2.Properties.ImageIndex = 0;
row3.Properties.ImageIndex = 0;
row4.Properties.ImageIndex = 0;
row5.Properties.ImageIndex = 0;
row6.Properties.ImageIndex = 0;
row7.Properties.ImageIndex = 0;
row8.Properties.ImageIndex = 0;

row10.Properties.ImageIndex = 0;
row11.Properties.ImageIndex = 0;
row12.Properties.ImageIndex = 0;

vGridControl1.RowHeaderWidth = 300;
// ComplexBestFit(new VGridControl[] { vGridControl1 });

vGridControl1.DataSource = dt.Tables[0];
//vGridControl1.BestFit();
connection.Dispose();
connection.Close();

}
Hepsi Bu kadar kolay Gelsin.


Ayrıca bknz.

Devexpress Grid Drag a column header here to group by that Remove Silme kaldırma

Devexpress Grid Drag a column header here to group by that Remove Silme kaldırma   …

Bir yorum

  1. arkadaşım ben angutum
    1 – bu kopyalanmıyor!
    2 – çalıntı içerik yayınlayıpda projemde yayınlamak istiyorum

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir