В GridView.DataSource= что писать? Имя папки, где находятся картинки, типа GridView1.DataSource= "~/uploads"; У меня именyо в папке, находящейся в проекте, все пикты находятся не понимает VS этот синтаксис <img src="http://www.gotdotnet.ru/Communities/Common/Images/Emoticons/Sad.gif"> GridViewPageEventArgs - этого вообще не видит, выдает как ошибку Видит лишь так GridView1.PageIndexChanged LoadDbData(); Что это? Resharper не видит и этого e.NewPageIndex Я уже похожий код писал. Ничего не работало. Откопал в MSDN за 2005 год вот это [c#]<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Import Namespace="System.Data" %>
<html>
<script runat="server">
ICollection CreateDataSource()
{
// Create sample data for the DataGrid control.
DataTable dt = new DataTable();
DataRow dr;
// Define the columns of the table.
dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
dt.Columns.Add(new DataColumn("StringValue", typeof(String)));
dt.Columns.Add(new DataColumn("CurrencyValue", typeof(Double)));
// Populate the table with sample values.
for (int i=0; i<=100; i++)
{
dr = dt.NewRow();
dr[0] = i;
dr[1] = "Item " + i.ToString();
dr[2] = 1.23 * (i + 1);
dt.Rows.Add(dr);
}
DataView dv = new DataView(dt);
return dv;
}
void Page_Load(Object sender, EventArgs e)
{
// Load sample data only once, when the page is first loaded.
if (!IsPostBack)
{
ItemsGrid.DataSource = CreateDataSource();
ItemsGrid.DataBind();
}
}
void Check_Change(Object sender, EventArgs e)
{
// Allow or prevent paging depending on the user's selection.
if (AllowPagingCheckBox.Checked)
{
ItemsGrid.AllowPaging = true;
}
else
{
ItemsGrid.AllowPaging = false;
}
// Rebind the data to refresh the DataGrid control.
ItemsGrid.DataSource = CreateDataSource();
ItemsGrid.DataBind();
}
void Grid_Change(Object sender, DataGridPageChangedEventArgs e)
{
// For the DataGrid control to navigate to the correct page when
// paging is allowed, the CurrentPageIndex property must be updated
// programmatically. This process is usually accomplished in the
// event-handling method for the PageIndexChanged event.
// Set CurrentPageIndex to the page the user clicked.
ItemsGrid.CurrentPageIndex = e.NewPageIndex;
// Rebind the data to refresh the DataGrid control.
ItemsGrid.DataSource = CreateDataSource();
ItemsGrid.DataBind();
}
[/c#]Вот что будет у меня вместо CreateDataSource(); честно, не врублюсь, да и ошибки те самые лезут. Не видит студия некоторых свойств.
Логика - друг программера...
Данное сообщение получено с сайта GotDotNet.RU
|