دو سوال: مشکل در منو + عدم وجود گزینه ی enable editing در گراید ویو
میخوام به روش طراحی دکمه ی ویرایش رو داخل گراید ویو قرار بدم. اما بعد از ایجاد گراید ویو و تعیین دیتا سورس، گزینه ی enable editing رو تو اون کادر گراید ویو نمی بینم. ببینید:
http://www.pic1.iran-forum.ir/images...6985637645.png
یه بار از طریق گزینه add new column و در مراحل بعد انتخاب command button یه دکمه ی ویرایش ساختم. ولی موقع اجرا server error داد:
Updating is not supported by data source 'dss' unless UpdateCommand is specified
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
samaram
میخوام به روش طراحی دکمه ی ویرایش رو داخل گراید ویو قرار بدم. اما بعد از ایجاد گراید ویو و تعیین دیتا سورس، گزینه ی enable editing رو تو اون کادر گراید ویو نمی بینم. ببینید:
http://www.pic1.iran-forum.ir/images...6985637645.png
یه بار از طریق گزینه add new column و در مراحل بعد انتخاب command button یه دکمه ی ویرایش ساختم. ولی موقع اجرا server error داد:
Updating is not supported by data source 'dss' unless UpdateCommand is specified
در قسمت EditTemplate داخل کدهای html گرید ویو می تونی این کارو بکنی
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
imanasp
در قسمت EditTemplate داخل کدهای html گرید ویو می تونی این کارو بکنی
چجوری؟
عذرمیخوام یه سوال دیگه هم دارم که گفتم شاید اگه براش تاپیک جدا نزنم بهتر باشه. منوهام رو با ابزار منوی خود ویژوال استودیو ساختم. حالا چطور تعریف کنم که با کلیلک روی یه گزینه به صفحه ی فلان بره؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
کد HTML:
<asp:GridView ID="grvCategory" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333"
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="">
<EditItemTemplate>
.
.
.
.
</EditItemTemplate>
</asp:GridView>
نقل قول:
عذرمیخوام یه سوال دیگه هم دارم که گفتم شاید اگه براش تاپیک جدا نزنم بهتر باشه. منوهام رو با ابزار منوی خود ویژوال استودیو ساختم. حالا چطور تعریف کنم که با کلیلک روی یه گزینه به صفحه ی فلان بره؟
تو خاصیت Navigate Url می تونید آدرس صفحه مورد نظرتون رو بدید
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
این کد که یه template میسازه . درسته؟ بعدشم تستش کردم خطا داد ظاهرا. اصلا چرا دیتاگریدویو بجای اون 5 تا گزینه همین سه تا رو داره؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
از پاسختون به سوال دومم هم ممنونم. مشکلم حل شد. حالا اگه فرض کنیم یه جدولی تو بانک داشته باشیم که اطلاعات شهرها رو داره. و یکی از گزینه های منو مثلا "شیراز" باشه . چطوری براش تعریف کنم که وقتی گزینه ی شیراز رو از منو انتخاب کرد به صفحه ی showdetails بره و اطلاعات شیراز رو از اون فیلد جدول بخونه؟ در واقع چجوری این مقدار شیراز رو از این منو بخونم و به یه صفحه ی دیگه بفرستم؟ تو اون صفحه چطور ازش استفاده کنم؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
samaram
از پاسختون به سوال دومم هم ممنونم. مشکلم حل شد. حالا اگه فرض کنیم یه جدولی تو بانک داشته باشیم که اطلاعات شهرها رو داره. و یکی از گزینه های منو مثلا "شیراز" باشه . چطوری براش تعریف کنم که وقتی گزینه ی شیراز رو از منو انتخاب کرد به صفحه ی showdetails بره و اطلاعات شیراز رو از اون فیلد جدول بخونه؟ در واقع چجوری این مقدار شیراز رو از این منو بخونم و به یه صفحه ی دیگه بفرستم؟ تو اون صفحه چطور ازش استفاده کنم؟
میتونید بار استفاده از queyString اطلاعات را بین صفحات مختلف رد و بدل کنید، راجع بهش مطالعه کنید
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
imanasp
میتونید بار استفاده از queyString اطلاعات را بین صفحات مختلف رد و بدل کنید، راجع بهش مطالعه کنید
میدونم چی می فرمایید. اما مساله اونجاست که نمیدونم چطور این خاصیت رو از یه گزینه ی منو بهش انتقال بدم. یعنی این کد رو کجای اون گزینه ی منو بنویسم؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
اگر توی sqlDataSource کوئری Update را بنویسید این گزینه به گرید ویو اضافه می شود.
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
TeacherMath
اگر توی sqlDataSource کوئری Update را بنویسید این گزینه به گرید ویو اضافه می شود.
من گراید ویو رو با طراحی گذاشتم رو صفحه و مقدار دادم. اینکاری که شما فرمودین رو هم انجام دادم. رفتم تو خاصیت updatequery دیتاسورس و با طراحی مراحل نوشتن کوئری رو انجام دادم. فقط حالا تو اون مرحله ی آخر که باید به پارامترها(@p یا @s و...) مقدار متناظرش رو از اون منوی کشویی روبرو بدم، نمیدونم برای این مورد که گزینه های یک سطر از گریدویو هستش کدوم گزینه رو از اون منوی کشویی انتخاب کنم؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
مشکل اولم حل شد. مشکل اونجا بود که برای جدولم اصلا فیلد کلیدی تعریف نکردم. بعدشم که تعریف کنید باید حتما این فیلد کلید توی دیتاسورستون انتخاب شده باشه.
اما مشکل دومم که با منوهاست سر جاشه. یعنی:
اگه فرض کنیم یه جدولی تو بانک داشته باشیم که اطلاعات شهرها رو داره. و یکی از گزینه های منو مثلا "شیراز" باشه . چطوری براش تعریف کنم که وقتی گزینه ی شیراز رو از منو انتخاب کرد به صفحه ی showdetails بره و اطلاعات شیراز رو از اون فیلد جدول بخونه؟ در واقع چجوری فشردن گزینه ی شیراز رو تشخیص بدم و بفرستمش به یه صفحه ی دیگه ؟ تو اون صفحه چطور ازش استفاده کنم؟
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
یعنی هیچکی نمیدونه؟ بابا یه سر نخی چیزی بهم بدین خودم برم یاد بگیرم خب
نقل قول: عدم وجود گزینه ی enable editing در گراید ویو
نقل قول:
نوشته شده توسط
samaram
مشکل اولم حل شد. مشکل اونجا بود که برای جدولم اصلا فیلد کلیدی تعریف نکردم. بعدشم که تعریف کنید باید حتما این فیلد کلید توی دیتاسورستون انتخاب شده باشه.
اما مشکل دومم که با منوهاست سر جاشه. یعنی:
اگه فرض کنیم یه جدولی تو بانک داشته باشیم که اطلاعات شهرها رو داره. و یکی از گزینه های منو مثلا "شیراز" باشه . چطوری براش تعریف کنم که وقتی گزینه ی شیراز رو از منو انتخاب کرد به صفحه ی showdetails بره و اطلاعات شیراز رو از اون فیلد جدول بخونه؟ در واقع چجوری فشردن گزینه ی شیراز رو تشخیص بدم و بفرستمش به یه صفحه ی دیگه ؟ تو اون صفحه چطور ازش استفاده کنم؟
راجع به QueryString و Reponse.redirect تحقیق کن تو همین سایت هست